From 6b42b80b4ecf9e52a49c1a2e02af320984d2ba67 Mon Sep 17 00:00:00 2001 From: API Team Date: Wed, 2 Sep 2026 15:39:34 +0000 Subject: [PATCH] [GitHub Bot] Generated python SDK --- .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 46 + .../.openapi-generator/VERSION | 1 + thousandeyes-sdk-bgp-updates/MANIFEST.in | 1 + thousandeyes-sdk-bgp-updates/README.md | 149 + .../docs/BGPUpdatesApi.md | 125 + .../docs/BgpDataExpandOption.md | 12 + .../docs/BgpMonitor.md | 35 + .../docs/BgpRpkiStatus.md | 12 + .../docs/BgpUpdate.md | 38 + .../docs/BgpUpdateType.md | 12 + .../docs/BgpUpdates.md | 30 + thousandeyes-sdk-bgp-updates/docs/Error.md | 33 + thousandeyes-sdk-bgp-updates/docs/Link.md | 37 + thousandeyes-sdk-bgp-updates/docs/Monitor.md | 34 + .../docs/MonitorType.md | 12 + .../docs/PaginationLinks.md | 32 + .../docs/UnauthorizedError.md | 30 + .../docs/ValidationError.md | 34 + .../docs/ValidationErrorItem.md | 31 + thousandeyes-sdk-bgp-updates/pyproject.toml | 82 + thousandeyes-sdk-bgp-updates/setup.cfg | 2 + .../thousandeyes_sdk/bgp_updates/__init__.py | 34 + .../bgp_updates/api/__init__.py | 5 + .../bgp_updates/api/bgp_updates_api.py | 562 +++ .../bgp_updates/models/__init__.py | 29 + .../models/bgp_data_expand_option.py | 40 + .../bgp_updates/models/bgp_monitor.py | 104 + .../bgp_updates/models/bgp_rpki_status.py | 43 + .../bgp_updates/models/bgp_update.py | 98 + .../bgp_updates/models/bgp_update_type.py | 42 + .../bgp_updates/models/bgp_updates.py | 101 + .../bgp_updates/models/error.py | 95 + .../bgp_updates/models/link.py | 101 + .../bgp_updates/models/monitor.py | 102 + .../bgp_updates/models/monitor_type.py | 41 + .../bgp_updates/models/pagination_links.py | 101 + .../bgp_updates/models/unauthorized_error.py | 89 + .../bgp_updates/models/validation_error.py | 110 + .../models/validation_error_item.py | 91 + .../src/thousandeyes_sdk/bgp_updates/py.typed | 0 thousandeyes-sdk-bgp-updates/test/__init__.py | 0 thousandeyes-sdk-bgp-updates/test/conftest.py | 7 + .../test/integration_test_utils.py | 37 + .../test/mock_manifest.py | 206 + .../test/test_bgp_updates_api.py | 111 + .../test/test_bgp_updates_api_integration.py | 622 +++ .../test/test_utils.py | 37 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 68 + .../.openapi-generator/VERSION | 1 + .../MANIFEST.in | 1 + .../README.md | 229 + .../docs/AwsFlowLogsIntegrationRequest.md | 31 + .../docs/AwsIntegrationPolicySetting.md | 33 + .../docs/AwsInventoryIntegrationRequest.md | 30 + .../docs/AwsMonitoringIntegration.md | 35 + .../docs/AwsMonitoringIntegrations.md | 31 + .../docs/AwsRegion.md | 12 + .../docs/AwsResourceGroupType.md | 12 + .../docs/AzureFlowLogsIntegrationRequest.md | 33 + .../docs/AzureIntegrationPolicySetting.md | 32 + .../docs/AzureInventoryIntegrationRequest.md | 32 + .../docs/AzureMonitoringIntegration.md | 36 + .../docs/AzureMonitoringIntegrations.md | 31 + .../docs/AzureResourceGroupType.md | 12 + ...oudInsightsIntegrationPolicySettingsApi.md | 350 ++ .../docs/CloudInsightsIntegrationsApi.md | 1212 +++++ .../docs/Error.md | 33 + .../docs/Link.md | 37 + .../docs/SelfLinks.md | 30 + .../docs/SubscriptionsPolicy.md | 31 + .../docs/SubscriptionsPolicyRule.md | 32 + .../docs/SubscriptionsPolicyRuleAction.md | 12 + .../docs/SubscriptionsPolicyRuleField.md | 12 + .../docs/UnauthorizedError.md | 30 + .../docs/ValidationError.md | 34 + .../docs/ValidationErrorItem.md | 31 + .../pyproject.toml | 82 + .../setup.cfg | 2 + .../cloud_insights_integrations/__init__.py | 44 + .../api/__init__.py | 6 + ...nsights_integration_policy_settings_api.py | 1222 +++++ .../api/cloud_insights_integrations_api.py | 4228 +++++++++++++++++ .../models/__init__.py | 38 + .../aws_flow_logs_integration_request.py | 91 + .../models/aws_integration_policy_setting.py | 99 + .../aws_inventory_integration_request.py | 89 + .../models/aws_monitoring_integration.py | 110 + .../models/aws_monitoring_integrations.py | 101 + .../models/aws_region.py | 71 + .../models/aws_resource_group_type.py | 47 + .../azure_flow_logs_integration_request.py | 95 + .../azure_integration_policy_setting.py | 100 + .../azure_inventory_integration_request.py | 93 + .../models/azure_monitoring_integration.py | 112 + .../models/azure_monitoring_integrations.py | 101 + .../models/azure_resource_group_type.py | 45 + .../models/error.py | 95 + .../models/link.py | 101 + .../models/self_links.py | 91 + .../models/subscriptions_policy.py | 99 + .../models/subscriptions_policy_rule.py | 93 + .../subscriptions_policy_rule_action.py | 41 + .../models/subscriptions_policy_rule_field.py | 41 + .../models/unauthorized_error.py | 89 + .../models/validation_error.py | 110 + .../models/validation_error_item.py | 91 + .../cloud_insights_integrations/py.typed | 0 .../test/__init__.py | 0 .../test/conftest.py | 7 + .../test/integration_test_utils.py | 37 + .../test/mock_manifest.py | 2012 ++++++++ ...nsights_integration_policy_settings_api.py | 213 + ...gration_policy_settings_api_integration.py | 1153 +++++ .../test_cloud_insights_integrations_api.py | 493 ++ ...d_insights_integrations_api_integration.py | 2903 +++++++++++ .../test/test_utils.py | 37 + 118 files changed, 20627 insertions(+) create mode 100644 thousandeyes-sdk-bgp-updates/.openapi-generator-ignore create mode 100644 thousandeyes-sdk-bgp-updates/.openapi-generator/FILES create mode 100644 thousandeyes-sdk-bgp-updates/.openapi-generator/VERSION create mode 100644 thousandeyes-sdk-bgp-updates/MANIFEST.in create mode 100644 thousandeyes-sdk-bgp-updates/README.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/BGPUpdatesApi.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/BgpDataExpandOption.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/BgpMonitor.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/BgpRpkiStatus.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/BgpUpdate.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/BgpUpdateType.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/BgpUpdates.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/Error.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/Link.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/Monitor.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/MonitorType.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/PaginationLinks.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/UnauthorizedError.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/ValidationError.md create mode 100644 thousandeyes-sdk-bgp-updates/docs/ValidationErrorItem.md create mode 100644 thousandeyes-sdk-bgp-updates/pyproject.toml create mode 100644 thousandeyes-sdk-bgp-updates/setup.cfg create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/__init__.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/api/__init__.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/api/bgp_updates_api.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/__init__.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_data_expand_option.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_monitor.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_rpki_status.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_update.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_update_type.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_updates.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/error.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/link.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/monitor.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/monitor_type.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/pagination_links.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/unauthorized_error.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/validation_error.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/validation_error_item.py create mode 100644 thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/py.typed create mode 100644 thousandeyes-sdk-bgp-updates/test/__init__.py create mode 100644 thousandeyes-sdk-bgp-updates/test/conftest.py create mode 100644 thousandeyes-sdk-bgp-updates/test/integration_test_utils.py create mode 100644 thousandeyes-sdk-bgp-updates/test/mock_manifest.py create mode 100644 thousandeyes-sdk-bgp-updates/test/test_bgp_updates_api.py create mode 100644 thousandeyes-sdk-bgp-updates/test/test_bgp_updates_api_integration.py create mode 100644 thousandeyes-sdk-bgp-updates/test/test_utils.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/.openapi-generator-ignore create mode 100644 thousandeyes-sdk-cloud-insights-integrations/.openapi-generator/FILES create mode 100644 thousandeyes-sdk-cloud-insights-integrations/.openapi-generator/VERSION create mode 100644 thousandeyes-sdk-cloud-insights-integrations/MANIFEST.in create mode 100644 thousandeyes-sdk-cloud-insights-integrations/README.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AwsFlowLogsIntegrationRequest.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AwsIntegrationPolicySetting.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AwsInventoryIntegrationRequest.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AwsMonitoringIntegration.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AwsMonitoringIntegrations.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AwsRegion.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AwsResourceGroupType.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AzureFlowLogsIntegrationRequest.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AzureIntegrationPolicySetting.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AzureInventoryIntegrationRequest.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AzureMonitoringIntegration.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AzureMonitoringIntegrations.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/AzureResourceGroupType.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationPolicySettingsApi.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/Error.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/Link.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/SelfLinks.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicy.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRule.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRuleAction.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRuleField.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/UnauthorizedError.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/ValidationError.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/docs/ValidationErrorItem.md create mode 100644 thousandeyes-sdk-cloud-insights-integrations/pyproject.toml create mode 100644 thousandeyes-sdk-cloud-insights-integrations/setup.cfg create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/__init__.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/__init__.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/cloud_insights_integration_policy_settings_api.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/cloud_insights_integrations_api.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/__init__.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_flow_logs_integration_request.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_integration_policy_setting.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_inventory_integration_request.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_monitoring_integration.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_monitoring_integrations.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_region.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_resource_group_type.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_flow_logs_integration_request.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_integration_policy_setting.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_inventory_integration_request.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_monitoring_integration.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_monitoring_integrations.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_resource_group_type.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/error.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/link.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/self_links.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule_action.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule_field.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/unauthorized_error.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/validation_error.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/validation_error_item.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/py.typed create mode 100644 thousandeyes-sdk-cloud-insights-integrations/test/__init__.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/test/conftest.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/test/integration_test_utils.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/test/mock_manifest.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integration_policy_settings_api.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integration_policy_settings_api_integration.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integrations_api.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integrations_api_integration.py create mode 100644 thousandeyes-sdk-cloud-insights-integrations/test/test_utils.py diff --git a/thousandeyes-sdk-bgp-updates/.openapi-generator-ignore b/thousandeyes-sdk-bgp-updates/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/thousandeyes-sdk-bgp-updates/.openapi-generator/FILES b/thousandeyes-sdk-bgp-updates/.openapi-generator/FILES new file mode 100644 index 00000000..34db7b6b --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/.openapi-generator/FILES @@ -0,0 +1,46 @@ +.openapi-generator-ignore +MANIFEST.in +README.md +docs/BGPUpdatesApi.md +docs/BgpDataExpandOption.md +docs/BgpMonitor.md +docs/BgpRpkiStatus.md +docs/BgpUpdate.md +docs/BgpUpdateType.md +docs/BgpUpdates.md +docs/Error.md +docs/Link.md +docs/Monitor.md +docs/MonitorType.md +docs/PaginationLinks.md +docs/UnauthorizedError.md +docs/ValidationError.md +docs/ValidationErrorItem.md +pyproject.toml +setup.cfg +src/thousandeyes_sdk/bgp_updates/__init__.py +src/thousandeyes_sdk/bgp_updates/api/__init__.py +src/thousandeyes_sdk/bgp_updates/api/bgp_updates_api.py +src/thousandeyes_sdk/bgp_updates/models/__init__.py +src/thousandeyes_sdk/bgp_updates/models/bgp_data_expand_option.py +src/thousandeyes_sdk/bgp_updates/models/bgp_monitor.py +src/thousandeyes_sdk/bgp_updates/models/bgp_rpki_status.py +src/thousandeyes_sdk/bgp_updates/models/bgp_update.py +src/thousandeyes_sdk/bgp_updates/models/bgp_update_type.py +src/thousandeyes_sdk/bgp_updates/models/bgp_updates.py +src/thousandeyes_sdk/bgp_updates/models/error.py +src/thousandeyes_sdk/bgp_updates/models/link.py +src/thousandeyes_sdk/bgp_updates/models/monitor.py +src/thousandeyes_sdk/bgp_updates/models/monitor_type.py +src/thousandeyes_sdk/bgp_updates/models/pagination_links.py +src/thousandeyes_sdk/bgp_updates/models/unauthorized_error.py +src/thousandeyes_sdk/bgp_updates/models/validation_error.py +src/thousandeyes_sdk/bgp_updates/models/validation_error_item.py +src/thousandeyes_sdk/bgp_updates/py.typed +test/__init__.py +test/conftest.py +test/integration_test_utils.py +test/mock_manifest.py +test/test_bgp_updates_api.py +test/test_bgp_updates_api_integration.py +test/test_utils.py diff --git a/thousandeyes-sdk-bgp-updates/.openapi-generator/VERSION b/thousandeyes-sdk-bgp-updates/.openapi-generator/VERSION new file mode 100644 index 00000000..93c8ddab --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.6.0 diff --git a/thousandeyes-sdk-bgp-updates/MANIFEST.in b/thousandeyes-sdk-bgp-updates/MANIFEST.in new file mode 100644 index 00000000..9a2248f5 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/MANIFEST.in @@ -0,0 +1 @@ +include docs/* diff --git a/thousandeyes-sdk-bgp-updates/README.md b/thousandeyes-sdk-bgp-updates/README.md new file mode 100644 index 00000000..4f982661 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/README.md @@ -0,0 +1,149 @@ +# thousandeyes-sdk-bgp-updates +Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 7.0.103 +- Generator version: 7.6.0 +- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator + +## Requirements. + +Python 3.9+ + +## Installation & Usage +### pip install + +Install directly via PyPi: + +```sh +pip install thousandeyes-sdk-bgp-updates +``` +(you may need to run `pip` with root permission: `sudo pip install thousandeyes-sdk-bgp-updates`) + +Then import the package: +```python +import thousandeyes_sdk.bgp_updates +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import thousandeyes_sdk.bgp_updates +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the installation procedure and then run the following: + +```python + +import thousandeyes_sdk.core +import thousandeyes_sdk.bgp_updates +from thousandeyes_sdk.core.exceptions import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.bgp_updates.BGPUpdatesApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + max = 20 # int | Maximum number of BGP updates to return. (optional) (default to 20) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + expand = ["monitor"] # List[BgpDataExpandOption] | Optional expansions. Pass `expand=monitor` to replace monitor IDs with full BGP monitor objects. (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) + prefix = ['[\"192.0.2.0/24\"]'] # List[str] | Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes. (optional) + origin_as = [[64512]] # List[int] | Origin AS filters. Repeat the parameter to filter by multiple ASNs. (optional) + as_path = ['[\"64512 64513\"]'] # List[str] | AS path filter, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths. (optional) + rpki_status = [ + 'Valid' + ] # List[BgpRpkiStatus] | RPKI status filters. (optional) + update_type = [ + 'announcement' + ] # List[BgpUpdateType] | BGP update type filters. (optional) + monitor = ['[\"101\"]'] # List[str] | BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint. (optional) + communities = ['[\"64512:100\"]'] # List[str] | BGP community filters. Repeat the parameter to filter by multiple communities. (optional) + + try: + # List BGP updates + api_response = api_instance.get_bgp_updates(aid=aid, max=max, cursor=cursor, expand=expand, start_date=start_date, end_date=end_date, prefix=prefix, origin_as=origin_as, as_path=as_path, rpki_status=rpki_status, update_type=update_type, monitor=monitor, communities=communities) + print("The response of BGPUpdatesApi->get_bgp_updates:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling BGPUpdatesApi->get_bgp_updates: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*BGPUpdatesApi* | [**get_bgp_updates**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/BGPUpdatesApi.md#get_bgp_updates) | **GET** /bgp/updates | List BGP updates + + +## Documentation For Models + + - [BgpDataExpandOption](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/BgpDataExpandOption.md) + - [BgpMonitor](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/BgpMonitor.md) + - [BgpRpkiStatus](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/BgpRpkiStatus.md) + - [BgpUpdate](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/BgpUpdate.md) + - [BgpUpdateType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/BgpUpdateType.md) + - [BgpUpdates](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/BgpUpdates.md) + - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/Error.md) + - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/Link.md) + - [Monitor](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/Monitor.md) + - [MonitorType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/MonitorType.md) + - [PaginationLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/PaginationLinks.md) + - [UnauthorizedError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/UnauthorizedError.md) + - [ValidationError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/ValidationError.md) + - [ValidationErrorItem](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-bgp-updates/docs/ValidationErrorItem.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + +ThousandEyes API Team + + diff --git a/thousandeyes-sdk-bgp-updates/docs/BGPUpdatesApi.md b/thousandeyes-sdk-bgp-updates/docs/BGPUpdatesApi.md new file mode 100644 index 00000000..ecc20491 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/BGPUpdatesApi.md @@ -0,0 +1,125 @@ +# thousandeyes_sdk.bgp_updates.BGPUpdatesApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_bgp_updates**](BGPUpdatesApi.md#get_bgp_updates) | **GET** /bgp/updates | List BGP updates + + +# **get_bgp_updates** +> BgpUpdates get_bgp_updates(aid=aid, max=max, cursor=cursor, expand=expand, start_date=start_date, end_date=end_date, prefix=prefix, origin_as=origin_as, as_path=as_path, rpki_status=rpki_status, update_type=update_type, monitor=monitor, communities=communities) + +List BGP updates + +Retrieves a paginated list of BGP updates for prefixes tracked by the account group. When `prefix` filters are omitted, updates are returned for all prefixes currently tracked by the account group. Use the returned pagination links to request subsequent pages. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.bgp_updates +from thousandeyes_sdk.bgp_updates.models.bgp_data_expand_option import BgpDataExpandOption +from thousandeyes_sdk.bgp_updates.models.bgp_rpki_status import BgpRpkiStatus +from thousandeyes_sdk.bgp_updates.models.bgp_update_type import BgpUpdateType +from thousandeyes_sdk.bgp_updates.models.bgp_updates import BgpUpdates +from thousandeyes_sdk.bgp_updates.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.bgp_updates.BGPUpdatesApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + max = 20 # int | Maximum number of BGP updates to return. (optional) (default to 20) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + expand = ["monitor"] # List[BgpDataExpandOption] | Optional expansions. Pass `expand=monitor` to replace monitor IDs with full BGP monitor objects. (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) + prefix = ['[\"192.0.2.0/24\"]'] # List[str] | Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes. (optional) + origin_as = [[64512]] # List[int] | Origin AS filters. Repeat the parameter to filter by multiple ASNs. (optional) + as_path = ['[\"64512 64513\"]'] # List[str] | AS path filter, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths. (optional) + rpki_status = [ + 'Valid' + ] # List[BgpRpkiStatus] | RPKI status filters. (optional) + update_type = [ + 'announcement' + ] # List[BgpUpdateType] | BGP update type filters. (optional) + monitor = ['[\"101\"]'] # List[str] | BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint. (optional) + communities = ['[\"64512:100\"]'] # List[str] | BGP community filters. Repeat the parameter to filter by multiple communities. (optional) + + try: + # List BGP updates + api_response = api_instance.get_bgp_updates(aid=aid, max=max, cursor=cursor, expand=expand, start_date=start_date, end_date=end_date, prefix=prefix, origin_as=origin_as, as_path=as_path, rpki_status=rpki_status, update_type=update_type, monitor=monitor, communities=communities) + print("The response of BGPUpdatesApi->get_bgp_updates:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BGPUpdatesApi->get_bgp_updates: %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] + **max** | **int**| Maximum number of BGP updates to return. | [optional] [default to 20] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + **expand** | [**List[BgpDataExpandOption]**](BgpDataExpandOption.md)| Optional expansions. Pass `expand=monitor` to replace monitor IDs with full BGP monitor objects. | [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] + **prefix** | [**List[str]**](str.md)| Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes. | [optional] + **origin_as** | [**List[int]**](int.md)| Origin AS filters. Repeat the parameter to filter by multiple ASNs. | [optional] + **as_path** | [**List[str]**](str.md)| AS path filter, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths. | [optional] + **rpki_status** | [**List[BgpRpkiStatus]**](BgpRpkiStatus.md)| RPKI status filters. | [optional] + **update_type** | [**List[BgpUpdateType]**](BgpUpdateType.md)| BGP update type filters. | [optional] + **monitor** | [**List[str]**](str.md)| BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint. | [optional] + **communities** | [**List[str]**](str.md)| BGP community filters. Repeat the parameter to filter by multiple communities. | [optional] + +### Return type + +[**BgpUpdates**](BgpUpdates.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** | List of BGP updates. | - | +**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/thousandeyes-sdk-bgp-updates/docs/BgpDataExpandOption.md b/thousandeyes-sdk-bgp-updates/docs/BgpDataExpandOption.md new file mode 100644 index 00000000..39f64ea9 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/BgpDataExpandOption.md @@ -0,0 +1,12 @@ +# BgpDataExpandOption + +Expandable BGP data response sub-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/thousandeyes-sdk-bgp-updates/docs/BgpMonitor.md b/thousandeyes-sdk-bgp-updates/docs/BgpMonitor.md new file mode 100644 index 00000000..7a1ebd8a --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/BgpMonitor.md @@ -0,0 +1,35 @@ +# BgpMonitor + + +## 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] +**asn** | **int** | Autonomous system number in which the monitor is found. | [optional] + +## Example + +```python +from thousandeyes_sdk.bgp_updates.models.bgp_monitor import BgpMonitor + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpMonitor from a JSON string +bgp_monitor_instance = BgpMonitor.from_json(json) +# print the JSON string representation of the object +print(BgpMonitor.to_json()) + +# convert the object into a dict +bgp_monitor_dict = bgp_monitor_instance.to_dict() +# create an instance of BgpMonitor from a dict +bgp_monitor_from_dict = BgpMonitor.from_dict(bgp_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/thousandeyes-sdk-bgp-updates/docs/BgpRpkiStatus.md b/thousandeyes-sdk-bgp-updates/docs/BgpRpkiStatus.md new file mode 100644 index 00000000..1981ba2c --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/BgpRpkiStatus.md @@ -0,0 +1,12 @@ +# BgpRpkiStatus + +RPKI validation status for BGP data, using the validation states defined in RFC 6811, Section 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/thousandeyes-sdk-bgp-updates/docs/BgpUpdate.md b/thousandeyes-sdk-bgp-updates/docs/BgpUpdate.md new file mode 100644 index 00000000..a54e2dcb --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/BgpUpdate.md @@ -0,0 +1,38 @@ +# BgpUpdate + +BGP update observed by a BGP monitor. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prefix** | **str** | IP prefix in CIDR notation. | +**origin_as** | **int** | Origin autonomous system (AS) number. Null when the update has no origin AS, including withdrawals. | +**as_path** | **List[int]** | AS path for the update. Empty when the update does not carry a path, including withdrawals. | +**communities** | **List[str]** | BGP communities attached to the update. Empty when the update does not carry communities, including withdrawals. | +**rpki_status** | [**BgpRpkiStatus**](BgpRpkiStatus.md) | RPKI validation status for the update, using the validation states defined in RFC 6811, Section 2. Returns NotAvailable when the update has no RPKI state, including withdrawals. | +**update_type** | [**BgpUpdateType**](BgpUpdateType.md) | Type of BGP update. | +**monitor_id** | **str** | BGP monitor ID that observed the update. Returned by default and omitted when `expand=monitor` is requested. | [optional] +**monitor** | [**BgpMonitor**](BgpMonitor.md) | BGP monitor that observed the update. Returned when `expand=monitor` is requested and replaces `monitorId`. | [optional] +**timestamp** | **datetime** | Date and time when the update was observed. | + +## Example + +```python +from thousandeyes_sdk.bgp_updates.models.bgp_update import BgpUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpUpdate from a JSON string +bgp_update_instance = BgpUpdate.from_json(json) +# print the JSON string representation of the object +print(BgpUpdate.to_json()) + +# convert the object into a dict +bgp_update_dict = bgp_update_instance.to_dict() +# create an instance of BgpUpdate from a dict +bgp_update_from_dict = BgpUpdate.from_dict(bgp_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/thousandeyes-sdk-bgp-updates/docs/BgpUpdateType.md b/thousandeyes-sdk-bgp-updates/docs/BgpUpdateType.md new file mode 100644 index 00000000..66bc7099 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/BgpUpdateType.md @@ -0,0 +1,12 @@ +# BgpUpdateType + +Type of BGP update. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-bgp-updates/docs/BgpUpdates.md b/thousandeyes-sdk-bgp-updates/docs/BgpUpdates.md new file mode 100644 index 00000000..5b97e385 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/BgpUpdates.md @@ -0,0 +1,30 @@ +# BgpUpdates + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**updates** | [**List[BgpUpdate]**](BgpUpdate.md) | | [optional] +**links** | [**PaginationLinks**](PaginationLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.bgp_updates.models.bgp_updates import BgpUpdates + +# TODO update the JSON string below +json = "{}" +# create an instance of BgpUpdates from a JSON string +bgp_updates_instance = BgpUpdates.from_json(json) +# print the JSON string representation of the object +print(BgpUpdates.to_json()) + +# convert the object into a dict +bgp_updates_dict = bgp_updates_instance.to_dict() +# create an instance of BgpUpdates from a dict +bgp_updates_from_dict = BgpUpdates.from_dict(bgp_updates_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-bgp-updates/docs/Error.md b/thousandeyes-sdk-bgp-updates/docs/Error.md new file mode 100644 index 00000000..637f730a --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/Error.md @@ -0,0 +1,33 @@ +# Error + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from thousandeyes_sdk.bgp_updates.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print(Error.to_json()) + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_from_dict = Error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-bgp-updates/docs/Link.md b/thousandeyes-sdk-bgp-updates/docs/Link.md new file mode 100644 index 00000000..26e64744 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/Link.md @@ -0,0 +1,37 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from thousandeyes_sdk.bgp_updates.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print(Link.to_json()) + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_from_dict = Link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-bgp-updates/docs/Monitor.md b/thousandeyes-sdk-bgp-updates/docs/Monitor.md new file mode 100644 index 00000000..7ef15378 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/Monitor.md @@ -0,0 +1,34 @@ +# 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 thousandeyes_sdk.bgp_updates.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_from_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/thousandeyes-sdk-bgp-updates/docs/MonitorType.md b/thousandeyes-sdk-bgp-updates/docs/MonitorType.md new file mode 100644 index 00000000..5f7d589b --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/MonitorType.md @@ -0,0 +1,12 @@ +# 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/thousandeyes-sdk-bgp-updates/docs/PaginationLinks.md b/thousandeyes-sdk-bgp-updates/docs/PaginationLinks.md new file mode 100644 index 00000000..4b8128e0 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/PaginationLinks.md @@ -0,0 +1,32 @@ +# PaginationLinks + +A links object containing pagination related link(s). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**previous** | [**Link**](Link.md) | | [optional] +**next** | [**Link**](Link.md) | | [optional] +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.bgp_updates.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_from_dict = PaginationLinks.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/thousandeyes-sdk-bgp-updates/docs/UnauthorizedError.md b/thousandeyes-sdk-bgp-updates/docs/UnauthorizedError.md new file mode 100644 index 00000000..2da89260 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/UnauthorizedError.md @@ -0,0 +1,30 @@ +# UnauthorizedError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from thousandeyes_sdk.bgp_updates.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print(UnauthorizedError.to_json()) + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_from_dict = UnauthorizedError.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-bgp-updates/docs/ValidationError.md b/thousandeyes-sdk-bgp-updates/docs/ValidationError.md new file mode 100644 index 00000000..74fead00 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/ValidationError.md @@ -0,0 +1,34 @@ +# ValidationError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] +**errors** | [**List[ValidationErrorItem]**](ValidationErrorItem.md) | (Optional) When multiple errors occur, the details for each error are listed. | [optional] + +## Example + +```python +from thousandeyes_sdk.bgp_updates.models.validation_error import ValidationError + +# TODO update the JSON string below +json = "{}" +# create an instance of ValidationError from a JSON string +validation_error_instance = ValidationError.from_json(json) +# print the JSON string representation of the object +print(ValidationError.to_json()) + +# convert the object into a dict +validation_error_dict = validation_error_instance.to_dict() +# create an instance of ValidationError from a dict +validation_error_from_dict = ValidationError.from_dict(validation_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-bgp-updates/docs/ValidationErrorItem.md b/thousandeyes-sdk-bgp-updates/docs/ValidationErrorItem.md new file mode 100644 index 00000000..940e2a34 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/docs/ValidationErrorItem.md @@ -0,0 +1,31 @@ +# ValidationErrorItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | (Optional) A unique error type/code that can be referenced in the documentation for further details. | [optional] +**var_field** | **str** | Identifies the field that triggered this particular error. | [optional] +**message** | **str** | A short, human-readable summary of the error. | [optional] + +## Example + +```python +from thousandeyes_sdk.bgp_updates.models.validation_error_item import ValidationErrorItem + +# TODO update the JSON string below +json = "{}" +# create an instance of ValidationErrorItem from a JSON string +validation_error_item_instance = ValidationErrorItem.from_json(json) +# print the JSON string representation of the object +print(ValidationErrorItem.to_json()) + +# convert the object into a dict +validation_error_item_dict = validation_error_item_instance.to_dict() +# create an instance of ValidationErrorItem from a dict +validation_error_item_from_dict = ValidationErrorItem.from_dict(validation_error_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-bgp-updates/pyproject.toml b/thousandeyes-sdk-bgp-updates/pyproject.toml new file mode 100644 index 00000000..5c727d63 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/pyproject.toml @@ -0,0 +1,82 @@ +[project] +name = "thousandeyes-sdk-bgp-updates" +dynamic = ["version"] +readme = "README.md" +authors = [ + { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } +] +description = "ThousandEyes SDK BGP Updates API" +license = { file = "LICENSE" } +requires-python = ">= 3.9" +dependencies = [ + "urllib3 >= 2.6.3", + "python-dateutil >=2.8.2", + "pydantic >=2.1.0", + "typing-extensions >=4.7.1", + "thousandeyes-sdk-core", +] + +[tool.setuptools.dynamic] +version = {file = ".version"} + +[project.optional-dependencies] +test = [ + "pytest~=7.1.3", + "pytest-cov>=2.8.1", + "pytest-randomly>=3.12.0", + "mypy>=1.4.1", + "types-python-dateutil>=2.8.19", +] +dev = [ + "flake8>=4.0.0", + "mypy>=1.4.1", + "types-python-dateutil>=2.8.19", +] + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +include-package-data = true + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "src", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/thousandeyes-sdk-bgp-updates/setup.cfg b/thousandeyes-sdk-bgp-updates/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/__init__.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/__init__.py new file mode 100644 index 00000000..ba36205d --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/__init__.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +# flake8: noqa + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import apis into sdk package +from thousandeyes_sdk.bgp_updates.api.bgp_updates_api import BGPUpdatesApi + + +# import models into sdk package +from thousandeyes_sdk.bgp_updates.models.bgp_data_expand_option import BgpDataExpandOption +from thousandeyes_sdk.bgp_updates.models.bgp_monitor import BgpMonitor +from thousandeyes_sdk.bgp_updates.models.bgp_rpki_status import BgpRpkiStatus +from thousandeyes_sdk.bgp_updates.models.bgp_update import BgpUpdate +from thousandeyes_sdk.bgp_updates.models.bgp_update_type import BgpUpdateType +from thousandeyes_sdk.bgp_updates.models.bgp_updates import BgpUpdates +from thousandeyes_sdk.bgp_updates.models.error import Error +from thousandeyes_sdk.bgp_updates.models.link import Link +from thousandeyes_sdk.bgp_updates.models.monitor import Monitor +from thousandeyes_sdk.bgp_updates.models.monitor_type import MonitorType +from thousandeyes_sdk.bgp_updates.models.pagination_links import PaginationLinks +from thousandeyes_sdk.bgp_updates.models.unauthorized_error import UnauthorizedError +from thousandeyes_sdk.bgp_updates.models.validation_error import ValidationError +from thousandeyes_sdk.bgp_updates.models.validation_error_item import ValidationErrorItem diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/api/__init__.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/api/__init__.py new file mode 100644 index 00000000..02d767f3 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/api/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa + +# import apis into api package +from thousandeyes_sdk.bgp_updates.api.bgp_updates_api import BGPUpdatesApi + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/api/bgp_updates_api.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/api/bgp_updates_api.py new file mode 100644 index 00000000..ebef6d4e --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/api/bgp_updates_api.py @@ -0,0 +1,562 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.bgp_updates.models + +from datetime import datetime +from pydantic import Field, StrictInt, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.bgp_updates.models.bgp_data_expand_option import BgpDataExpandOption +from thousandeyes_sdk.bgp_updates.models.bgp_rpki_status import BgpRpkiStatus +from thousandeyes_sdk.bgp_updates.models.bgp_update_type import BgpUpdateType +from thousandeyes_sdk.bgp_updates.models.bgp_updates import BgpUpdates + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.pagination_iterable import PaginationIterable +from thousandeyes_sdk.core.rest import RESTResponseType + + +class BGPUpdatesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-bgp-updates")) + self.api_client = api_client + + + @validate_call + def get_bgp_updates( + 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, + max: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum number of BGP updates to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[BgpDataExpandOption]], Field(description="Optional expansions. Pass `expand=monitor` to replace monitor IDs with full BGP monitor objects.")] = 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, + prefix: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes.")] = None, + origin_as: Annotated[Optional[Annotated[List[StrictInt], Field(max_length=1000)]], Field(description="Origin AS filters. Repeat the parameter to filter by multiple ASNs.")] = None, + as_path: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="AS path filter, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths.")] = None, + rpki_status: Annotated[Optional[Annotated[List[BgpRpkiStatus], Field(max_length=1000)]], Field(description="RPKI status filters.")] = None, + update_type: Annotated[Optional[Annotated[List[BgpUpdateType], Field(max_length=1000)]], Field(description="BGP update type filters.")] = None, + monitor: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint.")] = None, + communities: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="BGP community filters. Repeat the parameter to filter by multiple communities.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BgpUpdates: + """List BGP updates + + Retrieves a paginated list of BGP updates for prefixes tracked by the account group. When `prefix` filters are omitted, updates are returned for all prefixes currently tracked by the account group. Use the returned pagination links to request subsequent pages. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param max: Maximum number of BGP updates to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: Optional expansions. Pass `expand=monitor` to replace monitor IDs with full BGP monitor objects. + :type expand: List[BgpDataExpandOption] + :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 prefix: Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes. + :type prefix: List[str] + :param origin_as: Origin AS filters. Repeat the parameter to filter by multiple ASNs. + :type origin_as: List[int] + :param as_path: AS path filter, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths. + :type as_path: List[str] + :param rpki_status: RPKI status filters. + :type rpki_status: List[BgpRpkiStatus] + :param update_type: BGP update type filters. + :type update_type: List[BgpUpdateType] + :param monitor: BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint. + :type monitor: List[str] + :param communities: BGP community filters. Repeat the parameter to filter by multiple communities. + :type communities: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the 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_updates_serialize( + aid=aid, + max=max, + cursor=cursor, + expand=expand, + start_date=start_date, + end_date=end_date, + prefix=prefix, + origin_as=origin_as, + as_path=as_path, + rpki_status=rpki_status, + update_type=update_type, + monitor=monitor, + communities=communities, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpUpdates", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.bgp_updates.models, + ).data + + + @validate_call + def get_bgp_updates_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, + max: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum number of BGP updates to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[BgpDataExpandOption]], Field(description="Optional expansions. Pass `expand=monitor` to replace monitor IDs with full BGP monitor objects.")] = 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, + prefix: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes.")] = None, + origin_as: Annotated[Optional[Annotated[List[StrictInt], Field(max_length=1000)]], Field(description="Origin AS filters. Repeat the parameter to filter by multiple ASNs.")] = None, + as_path: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="AS path filter, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths.")] = None, + rpki_status: Annotated[Optional[Annotated[List[BgpRpkiStatus], Field(max_length=1000)]], Field(description="RPKI status filters.")] = None, + update_type: Annotated[Optional[Annotated[List[BgpUpdateType], Field(max_length=1000)]], Field(description="BGP update type filters.")] = None, + monitor: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint.")] = None, + communities: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="BGP community filters. Repeat the parameter to filter by multiple communities.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[BgpUpdates]: + """List BGP updates + + Retrieves a paginated list of BGP updates for prefixes tracked by the account group. When `prefix` filters are omitted, updates are returned for all prefixes currently tracked by the account group. Use the returned pagination links to request subsequent pages. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param max: Maximum number of BGP updates to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: Optional expansions. Pass `expand=monitor` to replace monitor IDs with full BGP monitor objects. + :type expand: List[BgpDataExpandOption] + :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 prefix: Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes. + :type prefix: List[str] + :param origin_as: Origin AS filters. Repeat the parameter to filter by multiple ASNs. + :type origin_as: List[int] + :param as_path: AS path filter, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths. + :type as_path: List[str] + :param rpki_status: RPKI status filters. + :type rpki_status: List[BgpRpkiStatus] + :param update_type: BGP update type filters. + :type update_type: List[BgpUpdateType] + :param monitor: BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint. + :type monitor: List[str] + :param communities: BGP community filters. Repeat the parameter to filter by multiple communities. + :type communities: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the 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_updates_serialize( + aid=aid, + max=max, + cursor=cursor, + expand=expand, + start_date=start_date, + end_date=end_date, + prefix=prefix, + origin_as=origin_as, + as_path=as_path, + rpki_status=rpki_status, + update_type=update_type, + monitor=monitor, + communities=communities, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpUpdates", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.bgp_updates.models, + ) + + + @validate_call + def get_bgp_updates_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, + max: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Maximum number of BGP updates to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + expand: Annotated[Optional[List[BgpDataExpandOption]], Field(description="Optional expansions. Pass `expand=monitor` to replace monitor IDs with full BGP monitor objects.")] = 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, + prefix: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes.")] = None, + origin_as: Annotated[Optional[Annotated[List[StrictInt], Field(max_length=1000)]], Field(description="Origin AS filters. Repeat the parameter to filter by multiple ASNs.")] = None, + as_path: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="AS path filter, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths.")] = None, + rpki_status: Annotated[Optional[Annotated[List[BgpRpkiStatus], Field(max_length=1000)]], Field(description="RPKI status filters.")] = None, + update_type: Annotated[Optional[Annotated[List[BgpUpdateType], Field(max_length=1000)]], Field(description="BGP update type filters.")] = None, + monitor: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint.")] = None, + communities: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="BGP community filters. Repeat the parameter to filter by multiple communities.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 updates + + Retrieves a paginated list of BGP updates for prefixes tracked by the account group. When `prefix` filters are omitted, updates are returned for all prefixes currently tracked by the account group. Use the returned pagination links to request subsequent pages. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param max: Maximum number of BGP updates to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param expand: Optional expansions. Pass `expand=monitor` to replace monitor IDs with full BGP monitor objects. + :type expand: List[BgpDataExpandOption] + :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 prefix: Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes. + :type prefix: List[str] + :param origin_as: Origin AS filters. Repeat the parameter to filter by multiple ASNs. + :type origin_as: List[int] + :param as_path: AS path filter, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths. + :type as_path: List[str] + :param rpki_status: RPKI status filters. + :type rpki_status: List[BgpRpkiStatus] + :param update_type: BGP update type filters. + :type update_type: List[BgpUpdateType] + :param monitor: BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint. + :type monitor: List[str] + :param communities: BGP community filters. Repeat the parameter to filter by multiple communities. + :type communities: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the 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_updates_serialize( + aid=aid, + max=max, + cursor=cursor, + expand=expand, + start_date=start_date, + end_date=end_date, + prefix=prefix, + origin_as=origin_as, + as_path=as_path, + rpki_status=rpki_status, + update_type=update_type, + monitor=monitor, + communities=communities, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "BgpUpdates", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_bgp_updates_serialize( + self, + aid, + max, + cursor, + expand, + start_date, + end_date, + prefix, + origin_as, + as_path, + rpki_status, + update_type, + monitor, + communities, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'expand': 'csv', + 'prefix': 'multi', + 'originAs': 'multi', + 'asPath': 'multi', + 'rpkiStatus': 'multi', + 'updateType': 'multi', + 'monitor': 'multi', + 'communities': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if 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)) + + 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 prefix is not None: + + _query_params.append(('prefix', prefix)) + + if origin_as is not None: + + _query_params.append(('originAs', origin_as)) + + if as_path is not None: + + _query_params.append(('asPath', as_path)) + + if rpki_status is not None: + + _query_params.append(('rpkiStatus', rpki_status)) + + if update_type is not None: + + _query_params.append(('updateType', update_type)) + + if monitor is not None: + + _query_params.append(('monitor', monitor)) + + if communities is not None: + + _query_params.append(('communities', communities)) + + # 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='/bgp/updates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/__init__.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/__init__.py new file mode 100644 index 00000000..4d96173a --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/__init__.py @@ -0,0 +1,29 @@ +# coding: utf-8 + +# flake8: noqa +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from thousandeyes_sdk.bgp_updates.models.bgp_data_expand_option import BgpDataExpandOption +from thousandeyes_sdk.bgp_updates.models.bgp_monitor import BgpMonitor +from thousandeyes_sdk.bgp_updates.models.bgp_rpki_status import BgpRpkiStatus +from thousandeyes_sdk.bgp_updates.models.bgp_update import BgpUpdate +from thousandeyes_sdk.bgp_updates.models.bgp_update_type import BgpUpdateType +from thousandeyes_sdk.bgp_updates.models.bgp_updates import BgpUpdates +from thousandeyes_sdk.bgp_updates.models.error import Error +from thousandeyes_sdk.bgp_updates.models.link import Link +from thousandeyes_sdk.bgp_updates.models.monitor import Monitor +from thousandeyes_sdk.bgp_updates.models.monitor_type import MonitorType +from thousandeyes_sdk.bgp_updates.models.pagination_links import PaginationLinks +from thousandeyes_sdk.bgp_updates.models.unauthorized_error import UnauthorizedError +from thousandeyes_sdk.bgp_updates.models.validation_error import ValidationError +from thousandeyes_sdk.bgp_updates.models.validation_error_item import ValidationErrorItem diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_data_expand_option.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_data_expand_option.py new file mode 100644 index 00000000..dea801bd --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_data_expand_option.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class BgpDataExpandOption(str, Enum): + """ + Expandable BGP data response sub-resources. + """ + + """ + allowed enum values + """ + MONITOR = 'monitor' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BgpDataExpandOption from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_monitor.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_monitor.py new file mode 100644 index 00000000..62700733 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_monitor.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.bgp_updates.models.monitor_type import MonitorType +from typing import Optional, Set +from typing_extensions import Self + +class BgpMonitor(BaseModel): + """ + BgpMonitor + """ # 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") + asn: Optional[StrictInt] = Field(default=None, description="Autonomous system number in which the monitor is found.") + __properties: ClassVar[List[str]] = ["countryId", "monitorId", "ipAddress", "network", "monitorType", "monitorName", "asn"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BgpMonitor from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "country_id", + "monitor_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpMonitor 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"), + "asn": obj.get("asn") + }) + return _obj + + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_rpki_status.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_rpki_status.py new file mode 100644 index 00000000..dd6a8799 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_rpki_status.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class BgpRpkiStatus(str, Enum): + """ + RPKI validation status for BGP data, using the validation states defined in RFC 6811, Section 2. + """ + + """ + allowed enum values + """ + VALID = 'Valid' + INVALID = 'Invalid' + NOTFOUND = 'NotFound' + NOTAVAILABLE = 'NotAvailable' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BgpRpkiStatus from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_update.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_update.py new file mode 100644 index 00000000..453f1538 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_update.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.bgp_updates.models.bgp_monitor import BgpMonitor +from thousandeyes_sdk.bgp_updates.models.bgp_rpki_status import BgpRpkiStatus +from thousandeyes_sdk.bgp_updates.models.bgp_update_type import BgpUpdateType +from typing import Optional, Set +from typing_extensions import Self + +class BgpUpdate(BaseModel): + """ + BGP update observed by a BGP monitor. + """ # noqa: E501 + prefix: StrictStr = Field(description="IP prefix in CIDR notation.") + origin_as: Optional[StrictInt] = Field(description="Origin autonomous system (AS) number. Null when the update has no origin AS, including withdrawals.", alias="originAs") + as_path: List[StrictInt] = Field(description="AS path for the update. Empty when the update does not carry a path, including withdrawals.", alias="asPath") + communities: List[StrictStr] = Field(description="BGP communities attached to the update. Empty when the update does not carry communities, including withdrawals.") + rpki_status: BgpRpkiStatus = Field(description="RPKI validation status for the update, using the validation states defined in RFC 6811, Section 2. Returns NotAvailable when the update has no RPKI state, including withdrawals.", alias="rpkiStatus") + update_type: BgpUpdateType = Field(description="Type of BGP update.", alias="updateType") + monitor_id: Optional[StrictStr] = Field(default=None, description="BGP monitor ID that observed the update. Returned by default and omitted when `expand=monitor` is requested.", alias="monitorId") + monitor: Optional[BgpMonitor] = Field(default=None, description="BGP monitor that observed the update. Returned when `expand=monitor` is requested and replaces `monitorId`.") + timestamp: datetime = Field(description="Date and time when the update was observed.") + __properties: ClassVar[List[str]] = [] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BgpUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + }) + return _obj + + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_update_type.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_update_type.py new file mode 100644 index 00000000..d2f48079 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_update_type.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class BgpUpdateType(str, Enum): + """ + Type of BGP update. + """ + + """ + allowed enum values + """ + ANNOUNCEMENT = 'announcement' + WITHDRAWAL = 'withdrawal' + UNSPECIFIED = 'unspecified' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BgpUpdateType from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_updates.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_updates.py new file mode 100644 index 00000000..d9cff283 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/bgp_updates.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.bgp_updates.models.bgp_update import BgpUpdate +from thousandeyes_sdk.bgp_updates.models.pagination_links import PaginationLinks +from typing import Optional, Set +from typing_extensions import Self + +class BgpUpdates(BaseModel): + """ + BgpUpdates + """ # noqa: E501 + updates: Optional[List[Optional[BgpUpdate]]] = None + links: Optional[PaginationLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["updates", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BgpUpdates from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in updates (list) + _items = [] + if self.updates: + for _item in self.updates: + if _item: + _items.append(_item.to_dict()) + _dict['updates'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BgpUpdates from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "updates": [BgpUpdate.from_dict(_item) for _item in obj["updates"]] if obj.get("updates") is not None else None, + "_links": PaginationLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/error.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/error.py new file mode 100644 index 00000000..d955b8ff --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/error.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Error(BaseModel): + """ + Error + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\".") + title: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the problem type.") + status: Optional[StrictInt] = Field(default=None, description="The HTTP status code generated by the origin server for this occurrence of the problem.") + detail: Optional[StrictStr] = Field(default=None, description="A human-readable explanation specific to this occurrence of the problem.") + instance: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the specific occurrence of the problem.") + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Error from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Error from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "status": obj.get("status"), + "detail": obj.get("detail"), + "instance": obj.get("instance") + }) + return _obj + + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/link.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/link.py new file mode 100644 index 00000000..990b2797 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/link.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Link(BaseModel): + """ + A hyperlink from the containing resource to a URI. + """ # noqa: E501 + href: StrictStr = Field(description="Its value is either a URI [RFC3986] or a URI template [RFC6570].") + templated: Optional[StrictBool] = Field(default=None, description="Should be true when the link object's \"href\" property is a URI template.") + type: Optional[StrictStr] = Field(default=None, description="Used as a hint to indicate the media type expected when dereferencing the target resource.") + deprecation: Optional[StrictStr] = Field(default=None, description="Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation.") + name: Optional[StrictStr] = Field(default=None, description="Its value may be used as a secondary key for selecting link objects that share the same relation type.") + profile: Optional[StrictStr] = Field(default=None, description="A URI that hints about the profile of the target resource.") + title: Optional[StrictStr] = Field(default=None, description="Intended for labelling the link with a human-readable identifier") + hreflang: Optional[StrictStr] = Field(default=None, description="Indicates the language of the target resource") + __properties: ClassVar[List[str]] = ["href", "templated", "type", "deprecation", "name", "profile", "title", "hreflang"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Link from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Link from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "href": obj.get("href"), + "templated": obj.get("templated"), + "type": obj.get("type"), + "deprecation": obj.get("deprecation"), + "name": obj.get("name"), + "profile": obj.get("profile"), + "title": obj.get("title"), + "hreflang": obj.get("hreflang") + }) + return _obj + + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/monitor.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/monitor.py new file mode 100644 index 00000000..a0dba0ac --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/monitor.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.bgp_updates.models.monitor_type import MonitorType +from typing import Optional, Set +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 = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of 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. + """ + excluded_fields: Set[str] = set([ + "country_id", + "monitor_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of 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/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/monitor_type.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/monitor_type.py new file mode 100644 index 00000000..48abf061 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/monitor_type.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class MonitorType(str, Enum): + """ + Type of monitor + """ + + """ + allowed enum values + """ + PUBLIC = 'public' + PRIVATE = 'private' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of MonitorType from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/pagination_links.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/pagination_links.py new file mode 100644 index 00000000..89371630 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/pagination_links.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.bgp_updates.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class PaginationLinks(BaseModel): + """ + A links object containing pagination related link(s). + """ # noqa: E501 + previous: Optional[Link] = None + next: Optional[Link] = None + var_self: Optional[Link] = Field(default=None, alias="self") + __properties: ClassVar[List[str]] = ["previous", "next", "self"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of 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. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of 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() + # override the default output from pydantic by calling `to_dict()` of var_self + if self.var_self: + _dict['self'] = self.var_self.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PaginationLinks 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["previous"]) if obj.get("previous") is not None else None, + "next": Link.from_dict(obj["next"]) if obj.get("next") is not None else None, + "self": Link.from_dict(obj["self"]) if obj.get("self") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/unauthorized_error.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/unauthorized_error.py new file mode 100644 index 00000000..93713ad8 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UnauthorizedError(BaseModel): + """ + UnauthorizedError + """ # noqa: E501 + error: Optional[StrictStr] = None + error_description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["error", "error_description"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnauthorizedError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnauthorizedError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "error_description": obj.get("error_description") + }) + return _obj + + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/validation_error.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/validation_error.py new file mode 100644 index 00000000..3d11d79d --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/validation_error.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.bgp_updates.models.validation_error_item import ValidationErrorItem +from typing import Optional, Set +from typing_extensions import Self + +class ValidationError(BaseModel): + """ + ValidationError + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\".") + title: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the problem type.") + status: Optional[StrictInt] = Field(default=None, description="The HTTP status code generated by the origin server for this occurrence of the problem.") + detail: Optional[StrictStr] = Field(default=None, description="A human-readable explanation specific to this occurrence of the problem.") + instance: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the specific occurrence of the problem.") + errors: Optional[List[ValidationErrorItem]] = Field(default=None, description="(Optional) When multiple errors occur, the details for each error are listed.") + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance", "errors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ValidationError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item in self.errors: + if _item: + _items.append(_item.to_dict()) + _dict['errors'] = _items + # set to None if errors (nullable) is None + # and model_fields_set contains the field + if self.errors is None and "errors" in self.model_fields_set: + _dict['errors'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ValidationError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "status": obj.get("status"), + "detail": obj.get("detail"), + "instance": obj.get("instance"), + "errors": [ValidationErrorItem.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/validation_error_item.py b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/validation_error_item.py new file mode 100644 index 00000000..7faf7794 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/models/validation_error_item.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ValidationErrorItem(BaseModel): + """ + ValidationErrorItem + """ # noqa: E501 + code: Optional[StrictStr] = Field(default=None, description="(Optional) A unique error type/code that can be referenced in the documentation for further details.") + var_field: Optional[StrictStr] = Field(default=None, description="Identifies the field that triggered this particular error.", alias="field") + message: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the error.") + __properties: ClassVar[List[str]] = ["code", "field", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ValidationErrorItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ValidationErrorItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "field": obj.get("field"), + "message": obj.get("message") + }) + return _obj + + diff --git a/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/py.typed b/thousandeyes-sdk-bgp-updates/src/thousandeyes_sdk/bgp_updates/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/thousandeyes-sdk-bgp-updates/test/__init__.py b/thousandeyes-sdk-bgp-updates/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/thousandeyes-sdk-bgp-updates/test/conftest.py b/thousandeyes-sdk-bgp-updates/test/conftest.py new file mode 100644 index 00000000..2edba7b3 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/test/conftest.py @@ -0,0 +1,7 @@ +import sys +from pathlib import Path + +_repo_root = Path(__file__).resolve().parents[2] +_core_test_support = _repo_root / "thousandeyes-sdk-core" / "test" +if str(_core_test_support) not in sys.path: + sys.path.insert(0, str(_core_test_support)) diff --git a/thousandeyes-sdk-bgp-updates/test/integration_test_utils.py b/thousandeyes-sdk-bgp-updates/test/integration_test_utils.py new file mode 100644 index 00000000..0b0e320b --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/test/integration_test_utils.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from thousandeyes_sdk.core.api_client import ApiClient +from thousandeyes_sdk.core.configuration import Configuration +from sdk_test_support.mock_server import ERROR_STATUS_HEADER, OPERATION_ID_HEADER, MockApiServer + +from .mock_manifest import OPERATION_MANIFEST + + +class IntegrationTestBase(unittest.TestCase): + def setUp(self) -> None: + self.server = MockApiServer(OPERATION_MANIFEST) + self.server.start() + configuration = Configuration(host=self.server.base_url, access_token="test-token") + self.api_client = ApiClient(configuration=configuration) + + def tearDown(self) -> None: + self.server.stop() + + def te_headers(self, operation_id: str, error_status=None): + headers = {OPERATION_ID_HEADER: operation_id} + if error_status is not None: + headers[ERROR_STATUS_HEADER] = error_status + return headers diff --git a/thousandeyes-sdk-bgp-updates/test/mock_manifest.py b/thousandeyes-sdk-bgp-updates/test/mock_manifest.py new file mode 100644 index 00000000..c5420217 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/test/mock_manifest.py @@ -0,0 +1,206 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json + +from sdk_test_support.mock_server_types import ErrorResponseExpectation, OperationExpectation + +OPERATION_MANIFEST = { + + "get_bgp_updates": OperationExpectation( + operation_id="get_bgp_updates", + method="GET", + path="/bgp/updates", + path_param_examples={ + }, + success_status=200, + success_body=json.loads(""" + + { + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "updates" : [ { + "monitorId" : "101", + "prefix" : "192.0.2.0/24", + "asPath" : [ 64512, 64513 ], + "originAs" : 64512, + "monitor" : { + "monitorId" : "101", + "ipAddress" : "10.0.0.1", + "asn" : 64512, + "monitorType" : "private", + "monitorName" : "Private monitor", + "countryId" : "US" + }, + "rpkiStatus" : "Valid", + "communities" : [ "64512:100" ], + "updateType" : "announcement", + "timestamp" : "2024-05-31T16:08:37Z" + }, { + "monitorId" : "101", + "prefix" : "192.0.2.0/24", + "asPath" : [ 64512, 64513 ], + "originAs" : 64512, + "monitor" : { + "monitorId" : "101", + "ipAddress" : "10.0.0.1", + "asn" : 64512, + "monitorType" : "private", + "monitorName" : "Private monitor", + "countryId" : "US" + }, + "rpkiStatus" : "Valid", + "communities" : [ "64512:100" ], + "updateType" : "announcement", + "timestamp" : "2024-05-31T16:08:37Z" + } ] + } + + """), + + success_content_type="application/json", + + request_body_example=None, + error_responses={ + + "400": ErrorResponseExpectation( + status=400, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + }"""), + content_type="application/json", + ), + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 6 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 6 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 6 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 6 + }"""), + content_type="application/json", + ), + + "502": ErrorResponseExpectation( + status=502, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 6 + }"""), + content_type="application/json", + ), + + }, + ), + +} diff --git a/thousandeyes-sdk-bgp-updates/test/test_bgp_updates_api.py b/thousandeyes-sdk-bgp-updates/test/test_bgp_updates_api.py new file mode 100644 index 00000000..38c99b58 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/test/test_bgp_updates_api.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.bgp_updates.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.bgp_updates.api.bgp_updates_api import BGPUpdatesApi + + +class TestBGPUpdatesApi(unittest.TestCase): + """BGPUpdatesApi unit test stubs""" + + def setUp(self) -> None: + self.api = BGPUpdatesApi() + + def tearDown(self) -> None: + pass + + def test_get_bgp_updates_models_validation(self) -> None: + """Test case for get_bgp_updates request and response models""" + + response_body_json = """ + { + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "updates" : [ { + "monitorId" : "101", + "prefix" : "192.0.2.0/24", + "asPath" : [ 64512, 64513 ], + "originAs" : 64512, + "monitor" : { + "monitorId" : "101", + "ipAddress" : "10.0.0.1", + "asn" : 64512, + "monitorType" : "private", + "monitorName" : "Private monitor", + "countryId" : "US" + }, + "rpkiStatus" : "Valid", + "communities" : [ "64512:100" ], + "updateType" : "announcement", + "timestamp" : "2024-05-31T16:08:37Z" + }, { + "monitorId" : "101", + "prefix" : "192.0.2.0/24", + "asPath" : [ 64512, 64513 ], + "originAs" : 64512, + "monitor" : { + "monitorId" : "101", + "ipAddress" : "10.0.0.1", + "asn" : 64512, + "monitorType" : "private", + "monitorName" : "Private monitor", + "countryId" : "US" + }, + "rpkiStatus" : "Valid", + "communities" : [ "64512:100" ], + "updateType" : "announcement", + "timestamp" : "2024-05-31T16:08:37Z" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.bgp_updates.models.BgpUpdates.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-bgp-updates/test/test_bgp_updates_api_integration.py b/thousandeyes-sdk-bgp-updates/test/test_bgp_updates_api_integration.py new file mode 100644 index 00000000..1c0e8769 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/test/test_bgp_updates_api_integration.py @@ -0,0 +1,622 @@ +# coding: utf-8 + +""" + BGP Updates API + + Retrieve BGP updates observed by BGP monitors tracking prefixes in your ThousandEyes account group. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.bgp_updates.models + +from thousandeyes_sdk.core.exceptions import ApiException +from thousandeyes_sdk.bgp_updates.api.bgp_updates_api import BGPUpdatesApi +from .integration_test_utils import IntegrationTestBase +from .test_utils import assert_constructed_model_matches_example_json + + +class TestBGPUpdatesApiIntegration(IntegrationTestBase): + """BGPUpdatesApi integration test stubs""" + + def setUp(self) -> None: + super().setUp() + self.api = BGPUpdatesApi(self.api_client) + + + def test_get_bgp_updates_happy_path(self) -> None: + """Integration test for get_bgp_updates success path""" + aid = '1234' + max = 20 + cursor = 'cursor_example' + expand = ["monitor"] + start_date = '2022-07-17T22:00:54Z' + end_date = '2022-07-18T22:00:54Z' + prefix = ['[\"192.0.2.0/24\"]'] + origin_as = [[64512]] + as_path = ['[\"64512 64513\"]'] + rpki_status = [ + 'Valid' + ] + update_type = [ + 'announcement' + ] + monitor = ['[\"101\"]'] + communities = ['[\"64512:100\"]'] + response_body_json = """ + { + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "previous" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "updates" : [ { + "monitorId" : "101", + "prefix" : "192.0.2.0/24", + "asPath" : [ 64512, 64513 ], + "originAs" : 64512, + "monitor" : { + "monitorId" : "101", + "ipAddress" : "10.0.0.1", + "asn" : 64512, + "monitorType" : "private", + "monitorName" : "Private monitor", + "countryId" : "US" + }, + "rpkiStatus" : "Valid", + "communities" : [ "64512:100" ], + "updateType" : "announcement", + "timestamp" : "2024-05-31T16:08:37Z" + }, { + "monitorId" : "101", + "prefix" : "192.0.2.0/24", + "asPath" : [ 64512, 64513 ], + "originAs" : 64512, + "monitor" : { + "monitorId" : "101", + "ipAddress" : "10.0.0.1", + "asn" : 64512, + "monitorType" : "private", + "monitorName" : "Private monitor", + "countryId" : "US" + }, + "rpkiStatus" : "Valid", + "communities" : [ "64512:100" ], + "updateType" : "announcement", + "timestamp" : "2024-05-31T16:08:37Z" + } ] + } + """ + expected_response = json.loads(response_body_json) + response = self.api.get_bgp_updates( + + aid=aid, + + max=max, + + cursor=cursor, + + expand=expand, + + start_date=start_date, + + end_date=end_date, + + prefix=prefix, + + origin_as=origin_as, + + as_path=as_path, + + rpki_status=rpki_status, + + update_type=update_type, + + monitor=monitor, + + communities=communities, + + _headers=self.te_headers("get_bgp_updates"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_get_bgp_updates_error_400(self) -> None: + """Integration test for get_bgp_updates error path (HTTP 400)""" + aid = '1234' + max = 20 + cursor = 'cursor_example' + expand = ["monitor"] + start_date = '2022-07-17T22:00:54Z' + end_date = '2022-07-18T22:00:54Z' + prefix = ['[\"192.0.2.0/24\"]'] + origin_as = [[64512]] + as_path = ['[\"64512 64513\"]'] + rpki_status = [ + 'Valid' + ] + update_type = [ + 'announcement' + ] + monitor = ['[\"101\"]'] + communities = ['[\"64512:100\"]'] + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(400) + ) as context: + self.api.get_bgp_updates( + + aid=aid, + + max=max, + + cursor=cursor, + + expand=expand, + + start_date=start_date, + + end_date=end_date, + + prefix=prefix, + + origin_as=origin_as, + + as_path=as_path, + + rpki_status=rpki_status, + + update_type=update_type, + + monitor=monitor, + + communities=communities, + + _headers=self.te_headers("get_bgp_updates", error_status="400"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_bgp_updates_error_401(self) -> None: + """Integration test for get_bgp_updates error path (HTTP 401)""" + aid = '1234' + max = 20 + cursor = 'cursor_example' + expand = ["monitor"] + start_date = '2022-07-17T22:00:54Z' + end_date = '2022-07-18T22:00:54Z' + prefix = ['[\"192.0.2.0/24\"]'] + origin_as = [[64512]] + as_path = ['[\"64512 64513\"]'] + rpki_status = [ + 'Valid' + ] + update_type = [ + 'announcement' + ] + monitor = ['[\"101\"]'] + communities = ['[\"64512:100\"]'] + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.get_bgp_updates( + + aid=aid, + + max=max, + + cursor=cursor, + + expand=expand, + + start_date=start_date, + + end_date=end_date, + + prefix=prefix, + + origin_as=origin_as, + + as_path=as_path, + + rpki_status=rpki_status, + + update_type=update_type, + + monitor=monitor, + + communities=communities, + + _headers=self.te_headers("get_bgp_updates", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_bgp_updates_error_403(self) -> None: + """Integration test for get_bgp_updates error path (HTTP 403)""" + aid = '1234' + max = 20 + cursor = 'cursor_example' + expand = ["monitor"] + start_date = '2022-07-17T22:00:54Z' + end_date = '2022-07-18T22:00:54Z' + prefix = ['[\"192.0.2.0/24\"]'] + origin_as = [[64512]] + as_path = ['[\"64512 64513\"]'] + rpki_status = [ + 'Valid' + ] + update_type = [ + 'announcement' + ] + monitor = ['[\"101\"]'] + communities = ['[\"64512:100\"]'] + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 6 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.get_bgp_updates( + + aid=aid, + + max=max, + + cursor=cursor, + + expand=expand, + + start_date=start_date, + + end_date=end_date, + + prefix=prefix, + + origin_as=origin_as, + + as_path=as_path, + + rpki_status=rpki_status, + + update_type=update_type, + + monitor=monitor, + + communities=communities, + + _headers=self.te_headers("get_bgp_updates", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_bgp_updates_error_404(self) -> None: + """Integration test for get_bgp_updates error path (HTTP 404)""" + aid = '1234' + max = 20 + cursor = 'cursor_example' + expand = ["monitor"] + start_date = '2022-07-17T22:00:54Z' + end_date = '2022-07-18T22:00:54Z' + prefix = ['[\"192.0.2.0/24\"]'] + origin_as = [[64512]] + as_path = ['[\"64512 64513\"]'] + rpki_status = [ + 'Valid' + ] + update_type = [ + 'announcement' + ] + monitor = ['[\"101\"]'] + communities = ['[\"64512:100\"]'] + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 6 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.get_bgp_updates( + + aid=aid, + + max=max, + + cursor=cursor, + + expand=expand, + + start_date=start_date, + + end_date=end_date, + + prefix=prefix, + + origin_as=origin_as, + + as_path=as_path, + + rpki_status=rpki_status, + + update_type=update_type, + + monitor=monitor, + + communities=communities, + + _headers=self.te_headers("get_bgp_updates", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_bgp_updates_error_429(self) -> None: + """Integration test for get_bgp_updates error path (HTTP 429)""" + aid = '1234' + max = 20 + cursor = 'cursor_example' + expand = ["monitor"] + start_date = '2022-07-17T22:00:54Z' + end_date = '2022-07-18T22:00:54Z' + prefix = ['[\"192.0.2.0/24\"]'] + origin_as = [[64512]] + as_path = ['[\"64512 64513\"]'] + rpki_status = [ + 'Valid' + ] + update_type = [ + 'announcement' + ] + monitor = ['[\"101\"]'] + communities = ['[\"64512:100\"]'] + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 6 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.get_bgp_updates( + + aid=aid, + + max=max, + + cursor=cursor, + + expand=expand, + + start_date=start_date, + + end_date=end_date, + + prefix=prefix, + + origin_as=origin_as, + + as_path=as_path, + + rpki_status=rpki_status, + + update_type=update_type, + + monitor=monitor, + + communities=communities, + + _headers=self.te_headers("get_bgp_updates", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_bgp_updates_error_500(self) -> None: + """Integration test for get_bgp_updates error path (HTTP 500)""" + aid = '1234' + max = 20 + cursor = 'cursor_example' + expand = ["monitor"] + start_date = '2022-07-17T22:00:54Z' + end_date = '2022-07-18T22:00:54Z' + prefix = ['[\"192.0.2.0/24\"]'] + origin_as = [[64512]] + as_path = ['[\"64512 64513\"]'] + rpki_status = [ + 'Valid' + ] + update_type = [ + 'announcement' + ] + monitor = ['[\"101\"]'] + communities = ['[\"64512:100\"]'] + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 6 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.get_bgp_updates( + + aid=aid, + + max=max, + + cursor=cursor, + + expand=expand, + + start_date=start_date, + + end_date=end_date, + + prefix=prefix, + + origin_as=origin_as, + + as_path=as_path, + + rpki_status=rpki_status, + + update_type=update_type, + + monitor=monitor, + + communities=communities, + + _headers=self.te_headers("get_bgp_updates", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_bgp_updates_error_502(self) -> None: + """Integration test for get_bgp_updates error path (HTTP 502)""" + aid = '1234' + max = 20 + cursor = 'cursor_example' + expand = ["monitor"] + start_date = '2022-07-17T22:00:54Z' + end_date = '2022-07-18T22:00:54Z' + prefix = ['[\"192.0.2.0/24\"]'] + origin_as = [[64512]] + as_path = ['[\"64512 64513\"]'] + rpki_status = [ + 'Valid' + ] + update_type = [ + 'announcement' + ] + monitor = ['[\"101\"]'] + communities = ['[\"64512:100\"]'] + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 6 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(502) + ) as context: + self.api.get_bgp_updates( + + aid=aid, + + max=max, + + cursor=cursor, + + expand=expand, + + start_date=start_date, + + end_date=end_date, + + prefix=prefix, + + origin_as=origin_as, + + as_path=as_path, + + rpki_status=rpki_status, + + update_type=update_type, + + monitor=monitor, + + communities=communities, + + _headers=self.te_headers("get_bgp_updates", error_status="502"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-bgp-updates/test/test_utils.py b/thousandeyes-sdk-bgp-updates/test/test_utils.py new file mode 100644 index 00000000..37913f62 --- /dev/null +++ b/thousandeyes-sdk-bgp-updates/test/test_utils.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +import json +import unittest +from typing import Any + +from pydantic import BaseModel + + +def _project_onto_constructed(expected: Any, constructed: Any) -> Any: + """Keep only example fields that appear in the constructed model output.""" + if isinstance(constructed, dict): + if not isinstance(expected, dict): + return expected + return { + key: _project_onto_constructed(expected.get(key), value) + for key, value in constructed.items() + } + if isinstance(constructed, list): + if not isinstance(expected, list): + return expected + return [ + _project_onto_constructed(expected[index], value) + for index, value in enumerate(constructed) + ] + return expected + + +def assert_constructed_model_matches_example_json(model: BaseModel, loaded_json: dict): + test_case = unittest.TestCase() + test_case.maxDiff = None + test_case.assertIsNotNone(model) + constructed_json = json.loads(model.to_json()) + projected_loaded_json = _project_onto_constructed(loaded_json, constructed_json) + sorted_loaded_json = json.dumps(projected_loaded_json, sort_keys=True) + sorted_constructed_json = json.dumps(constructed_json, sort_keys=True) + test_case.assertEqual(sorted_loaded_json, sorted_constructed_json) diff --git a/thousandeyes-sdk-cloud-insights-integrations/.openapi-generator-ignore b/thousandeyes-sdk-cloud-insights-integrations/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/thousandeyes-sdk-cloud-insights-integrations/.openapi-generator/FILES b/thousandeyes-sdk-cloud-insights-integrations/.openapi-generator/FILES new file mode 100644 index 00000000..d87d06fa --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/.openapi-generator/FILES @@ -0,0 +1,68 @@ +.openapi-generator-ignore +MANIFEST.in +README.md +docs/AwsFlowLogsIntegrationRequest.md +docs/AwsIntegrationPolicySetting.md +docs/AwsInventoryIntegrationRequest.md +docs/AwsMonitoringIntegration.md +docs/AwsMonitoringIntegrations.md +docs/AwsRegion.md +docs/AwsResourceGroupType.md +docs/AzureFlowLogsIntegrationRequest.md +docs/AzureIntegrationPolicySetting.md +docs/AzureInventoryIntegrationRequest.md +docs/AzureMonitoringIntegration.md +docs/AzureMonitoringIntegrations.md +docs/AzureResourceGroupType.md +docs/CloudInsightsIntegrationPolicySettingsApi.md +docs/CloudInsightsIntegrationsApi.md +docs/Error.md +docs/Link.md +docs/SelfLinks.md +docs/SubscriptionsPolicy.md +docs/SubscriptionsPolicyRule.md +docs/SubscriptionsPolicyRuleAction.md +docs/SubscriptionsPolicyRuleField.md +docs/UnauthorizedError.md +docs/ValidationError.md +docs/ValidationErrorItem.md +pyproject.toml +setup.cfg +src/thousandeyes_sdk/cloud_insights_integrations/__init__.py +src/thousandeyes_sdk/cloud_insights_integrations/api/__init__.py +src/thousandeyes_sdk/cloud_insights_integrations/api/cloud_insights_integration_policy_settings_api.py +src/thousandeyes_sdk/cloud_insights_integrations/api/cloud_insights_integrations_api.py +src/thousandeyes_sdk/cloud_insights_integrations/models/__init__.py +src/thousandeyes_sdk/cloud_insights_integrations/models/aws_flow_logs_integration_request.py +src/thousandeyes_sdk/cloud_insights_integrations/models/aws_integration_policy_setting.py +src/thousandeyes_sdk/cloud_insights_integrations/models/aws_inventory_integration_request.py +src/thousandeyes_sdk/cloud_insights_integrations/models/aws_monitoring_integration.py +src/thousandeyes_sdk/cloud_insights_integrations/models/aws_monitoring_integrations.py +src/thousandeyes_sdk/cloud_insights_integrations/models/aws_region.py +src/thousandeyes_sdk/cloud_insights_integrations/models/aws_resource_group_type.py +src/thousandeyes_sdk/cloud_insights_integrations/models/azure_flow_logs_integration_request.py +src/thousandeyes_sdk/cloud_insights_integrations/models/azure_integration_policy_setting.py +src/thousandeyes_sdk/cloud_insights_integrations/models/azure_inventory_integration_request.py +src/thousandeyes_sdk/cloud_insights_integrations/models/azure_monitoring_integration.py +src/thousandeyes_sdk/cloud_insights_integrations/models/azure_monitoring_integrations.py +src/thousandeyes_sdk/cloud_insights_integrations/models/azure_resource_group_type.py +src/thousandeyes_sdk/cloud_insights_integrations/models/error.py +src/thousandeyes_sdk/cloud_insights_integrations/models/link.py +src/thousandeyes_sdk/cloud_insights_integrations/models/self_links.py +src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy.py +src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule.py +src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule_action.py +src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule_field.py +src/thousandeyes_sdk/cloud_insights_integrations/models/unauthorized_error.py +src/thousandeyes_sdk/cloud_insights_integrations/models/validation_error.py +src/thousandeyes_sdk/cloud_insights_integrations/models/validation_error_item.py +src/thousandeyes_sdk/cloud_insights_integrations/py.typed +test/__init__.py +test/conftest.py +test/integration_test_utils.py +test/mock_manifest.py +test/test_cloud_insights_integration_policy_settings_api.py +test/test_cloud_insights_integration_policy_settings_api_integration.py +test/test_cloud_insights_integrations_api.py +test/test_cloud_insights_integrations_api_integration.py +test/test_utils.py diff --git a/thousandeyes-sdk-cloud-insights-integrations/.openapi-generator/VERSION b/thousandeyes-sdk-cloud-insights-integrations/.openapi-generator/VERSION new file mode 100644 index 00000000..93c8ddab --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.6.0 diff --git a/thousandeyes-sdk-cloud-insights-integrations/MANIFEST.in b/thousandeyes-sdk-cloud-insights-integrations/MANIFEST.in new file mode 100644 index 00000000..9a2248f5 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/MANIFEST.in @@ -0,0 +1 @@ +include docs/* diff --git a/thousandeyes-sdk-cloud-insights-integrations/README.md b/thousandeyes-sdk-cloud-insights-integrations/README.md new file mode 100644 index 00000000..09a70837 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/README.md @@ -0,0 +1,229 @@ +# thousandeyes-sdk-cloud-insights-integrations +**Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. + +The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. + + +### What You Can Do + +- **List** all integrations. + +- **Get** details for a specific integration. + +- **Delete** an existing integration. + +- **Create** integrations for: + + - **AWS**: inventory monitoring and flow logs monitoring. + + - **Azure**: inventory monitoring and flow logs monitoring. + +- **Update** integrations for: + + - **Azure**: inventory monitoring and flow logs monitoring. + +- **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. + +- **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. + +- **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. + + +### Scope and Tenancy + +All operations are scoped to the authenticated account group. Responses include only resources associated with that group. + + +### Payloads and formats + +- **Requests:** `application/json` + +- **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. + +- HAL responses include `_links` with a `self` relation for direct navigation. + + +### Integration Types + +- **Inventory monitoring** + + - AWS: reads inventory and network topology via read-only IAM permissions. + + - Azure: authenticates with a Service Principal to read inventory and network topology. + +- **Flow logs monitoring** + + - AWS: reads flow logs from S3 buckets and uses SNS for notifications. + + - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). + + +### Policy Helpers (AWS) + +Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. + + +### Notes + +- All example values in this specification are **fictitious**. + + +For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 7.0.103 +- Generator version: 7.6.0 +- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator + +## Requirements. + +Python 3.9+ + +## Installation & Usage +### pip install + +Install directly via PyPi: + +```sh +pip install thousandeyes-sdk-cloud-insights-integrations +``` +(you may need to run `pip` with root permission: `sudo pip install thousandeyes-sdk-cloud-insights-integrations`) + +Then import the package: +```python +import thousandeyes_sdk.cloud_insights_integrations +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import thousandeyes_sdk.cloud_insights_integrations +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the installation procedure and then run the following: + +```python + +import thousandeyes_sdk.core +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.core.exceptions import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationPolicySettingsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get AWS integration policy settings + api_response = api_instance.get_aws_integration_policy_settings(aid=aid) + print("The response of CloudInsightsIntegrationPolicySettingsApi->get_aws_integration_policy_settings:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling CloudInsightsIntegrationPolicySettingsApi->get_aws_integration_policy_settings: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CloudInsightsIntegrationPolicySettingsApi* | [**get_aws_integration_policy_settings**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationPolicySettingsApi.md#get_aws_integration_policy_settings) | **GET** /cloud-insights/integration/aws/policy/settings | Get AWS integration policy settings +*CloudInsightsIntegrationPolicySettingsApi* | [**get_azure_integration_policy_settings**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationPolicySettingsApi.md#get_azure_integration_policy_settings) | **GET** /cloud-insights/integration/azure/policy/settings | Get Azure integration policy settings +*CloudInsightsIntegrationPolicySettingsApi* | [**update_aws_integration_policy_settings**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationPolicySettingsApi.md#update_aws_integration_policy_settings) | **PUT** /cloud-insights/integration/aws/policy/settings | Update AWS integration policy settings +*CloudInsightsIntegrationPolicySettingsApi* | [**update_azure_integration_policy_settings**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationPolicySettingsApi.md#update_azure_integration_policy_settings) | **PUT** /cloud-insights/integration/azure/policy/settings | Update Azure integration policy settings +*CloudInsightsIntegrationsApi* | [**create_aws_flow_logs_monitoring_integration**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#create_aws_flow_logs_monitoring_integration) | **POST** /cloud-insights/integration/aws/flow-logs | Create AWS flow logs monitoring integration +*CloudInsightsIntegrationsApi* | [**create_aws_inventory_monitoring_integration**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#create_aws_inventory_monitoring_integration) | **POST** /cloud-insights/integration/aws/inventory | Create AWS inventory monitoring integration +*CloudInsightsIntegrationsApi* | [**create_azure_flow_logs_monitoring_integration**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#create_azure_flow_logs_monitoring_integration) | **POST** /cloud-insights/integration/azure/flow-logs | Create Azure flow logs monitoring integration +*CloudInsightsIntegrationsApi* | [**create_azure_inventory_monitoring_integration**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#create_azure_inventory_monitoring_integration) | **POST** /cloud-insights/integration/azure/inventory | Create Azure inventory monitoring integration +*CloudInsightsIntegrationsApi* | [**delete_aws_monitoring_integration**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#delete_aws_monitoring_integration) | **DELETE** /cloud-insights/integration/aws/{integrationId} | Delete AWS integration +*CloudInsightsIntegrationsApi* | [**delete_azure_monitoring_integration**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#delete_azure_monitoring_integration) | **DELETE** /cloud-insights/integration/azure/{integrationId} | Delete Azure integration +*CloudInsightsIntegrationsApi* | [**get_all_aws_monitoring_integrations**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#get_all_aws_monitoring_integrations) | **GET** /cloud-insights/integration/aws | List AWS integrations +*CloudInsightsIntegrationsApi* | [**get_all_azure_monitoring_integrations**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#get_all_azure_monitoring_integrations) | **GET** /cloud-insights/integration/azure | List Azure integrations +*CloudInsightsIntegrationsApi* | [**get_aws_flowlogs_monitoring_integration_policies**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#get_aws_flowlogs_monitoring_integration_policies) | **GET** /cloud-insights/integration/aws/flow-logs/policies | Get AWS flow logs monitoring IAM policies +*CloudInsightsIntegrationsApi* | [**get_aws_inventory_monitoring_integration_policies**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#get_aws_inventory_monitoring_integration_policies) | **GET** /cloud-insights/integration/aws/inventory/policies | Get AWS inventory monitoring IAM policies +*CloudInsightsIntegrationsApi* | [**get_aws_monitoring_integration**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#get_aws_monitoring_integration) | **GET** /cloud-insights/integration/aws/{integrationId} | Get AWS integration +*CloudInsightsIntegrationsApi* | [**get_azure_monitoring_integration**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#get_azure_monitoring_integration) | **GET** /cloud-insights/integration/azure/{integrationId} | Get Azure integration +*CloudInsightsIntegrationsApi* | [**update_azure_flow_logs_monitoring_integration**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#update_azure_flow_logs_monitoring_integration) | **PUT** /cloud-insights/integration/azure/flow-logs/{integrationId} | Update Azure flow logs monitoring integration +*CloudInsightsIntegrationsApi* | [**update_azure_inventory_monitoring_integration**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md#update_azure_inventory_monitoring_integration) | **PUT** /cloud-insights/integration/azure/inventory/{integrationId} | Update Azure inventory monitoring integration + + +## Documentation For Models + + - [AwsFlowLogsIntegrationRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AwsFlowLogsIntegrationRequest.md) + - [AwsIntegrationPolicySetting](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AwsIntegrationPolicySetting.md) + - [AwsInventoryIntegrationRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AwsInventoryIntegrationRequest.md) + - [AwsMonitoringIntegration](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AwsMonitoringIntegration.md) + - [AwsMonitoringIntegrations](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AwsMonitoringIntegrations.md) + - [AwsRegion](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AwsRegion.md) + - [AwsResourceGroupType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AwsResourceGroupType.md) + - [AzureFlowLogsIntegrationRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AzureFlowLogsIntegrationRequest.md) + - [AzureIntegrationPolicySetting](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AzureIntegrationPolicySetting.md) + - [AzureInventoryIntegrationRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AzureInventoryIntegrationRequest.md) + - [AzureMonitoringIntegration](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AzureMonitoringIntegration.md) + - [AzureMonitoringIntegrations](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AzureMonitoringIntegrations.md) + - [AzureResourceGroupType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/AzureResourceGroupType.md) + - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/Error.md) + - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/Link.md) + - [SelfLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/SelfLinks.md) + - [SubscriptionsPolicy](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicy.md) + - [SubscriptionsPolicyRule](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRule.md) + - [SubscriptionsPolicyRuleAction](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRuleAction.md) + - [SubscriptionsPolicyRuleField](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRuleField.md) + - [UnauthorizedError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/UnauthorizedError.md) + - [ValidationError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/ValidationError.md) + - [ValidationErrorItem](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-cloud-insights-integrations/docs/ValidationErrorItem.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + +ThousandEyes API Team + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/AwsFlowLogsIntegrationRequest.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsFlowLogsIntegrationRequest.md new file mode 100644 index 00000000..09130fd5 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsFlowLogsIntegrationRequest.md @@ -0,0 +1,31 @@ +# AwsFlowLogsIntegrationRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the AWS flow logs monitoring integration. | +**role_arn** | **str** | The ARN of the AWS role to be monitored. | +**sns_topics_arns** | **List[str]** | The array of SNS topics ARNs. | + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.aws_flow_logs_integration_request import AwsFlowLogsIntegrationRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AwsFlowLogsIntegrationRequest from a JSON string +aws_flow_logs_integration_request_instance = AwsFlowLogsIntegrationRequest.from_json(json) +# print the JSON string representation of the object +print(AwsFlowLogsIntegrationRequest.to_json()) + +# convert the object into a dict +aws_flow_logs_integration_request_dict = aws_flow_logs_integration_request_instance.to_dict() +# create an instance of AwsFlowLogsIntegrationRequest from a dict +aws_flow_logs_integration_request_from_dict = AwsFlowLogsIntegrationRequest.from_dict(aws_flow_logs_integration_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/thousandeyes-sdk-cloud-insights-integrations/docs/AwsIntegrationPolicySetting.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsIntegrationPolicySetting.md new file mode 100644 index 00000000..7e67e8c2 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsIntegrationPolicySetting.md @@ -0,0 +1,33 @@ +# AwsIntegrationPolicySetting + +AWS integration policy configuration that controls which resource groups and regions ThousandEyes inventories, and whether CloudTrail is enabled. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled_resource_group_types** | [**List[AwsResourceGroupType]**](AwsResourceGroupType.md) | The set of AWS resource group types included in inventory monitoring. | +**enabled_regions** | [**List[AwsRegion]**](AwsRegion.md) | The AWS regions that ThousandEyes inventories for the account group. | +**enabled_cloudtrail** | **bool** | Indicates whether CloudTrail integration is enabled for AWS inventory monitoring. | +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.aws_integration_policy_setting import AwsIntegrationPolicySetting + +# TODO update the JSON string below +json = "{}" +# create an instance of AwsIntegrationPolicySetting from a JSON string +aws_integration_policy_setting_instance = AwsIntegrationPolicySetting.from_json(json) +# print the JSON string representation of the object +print(AwsIntegrationPolicySetting.to_json()) + +# convert the object into a dict +aws_integration_policy_setting_dict = aws_integration_policy_setting_instance.to_dict() +# create an instance of AwsIntegrationPolicySetting from a dict +aws_integration_policy_setting_from_dict = AwsIntegrationPolicySetting.from_dict(aws_integration_policy_setting_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/AwsInventoryIntegrationRequest.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsInventoryIntegrationRequest.md new file mode 100644 index 00000000..d2daac1b --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsInventoryIntegrationRequest.md @@ -0,0 +1,30 @@ +# AwsInventoryIntegrationRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the AWS inventory monitoring integration. | +**role_arn** | **str** | The ARN of the AWS role to be monitored. | + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.aws_inventory_integration_request import AwsInventoryIntegrationRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AwsInventoryIntegrationRequest from a JSON string +aws_inventory_integration_request_instance = AwsInventoryIntegrationRequest.from_json(json) +# print the JSON string representation of the object +print(AwsInventoryIntegrationRequest.to_json()) + +# convert the object into a dict +aws_inventory_integration_request_dict = aws_inventory_integration_request_instance.to_dict() +# create an instance of AwsInventoryIntegrationRequest from a dict +aws_inventory_integration_request_from_dict = AwsInventoryIntegrationRequest.from_dict(aws_inventory_integration_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/thousandeyes-sdk-cloud-insights-integrations/docs/AwsMonitoringIntegration.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsMonitoringIntegration.md new file mode 100644 index 00000000..78f1bda1 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsMonitoringIntegration.md @@ -0,0 +1,35 @@ +# AwsMonitoringIntegration + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique ID for the AWS inventory or flow logs monitoring integration. | +**name** | **str** | The name of the AWS inventory or flow logs monitoring integration. | +**role_arn** | **str** | The ARN of the AWS role to be monitored. | +**external_id** | **str** | The external ID associated with the account group. | +**monitoring_type** | **str** | The type of monitoring integration. | +**sns_topics_arns** | **List[str]** | The array of SNS topic ARNs. Relevant only for flow logs monitoring integrations. | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integration import AwsMonitoringIntegration + +# TODO update the JSON string below +json = "{}" +# create an instance of AwsMonitoringIntegration from a JSON string +aws_monitoring_integration_instance = AwsMonitoringIntegration.from_json(json) +# print the JSON string representation of the object +print(AwsMonitoringIntegration.to_json()) + +# convert the object into a dict +aws_monitoring_integration_dict = aws_monitoring_integration_instance.to_dict() +# create an instance of AwsMonitoringIntegration from a dict +aws_monitoring_integration_from_dict = AwsMonitoringIntegration.from_dict(aws_monitoring_integration_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/AwsMonitoringIntegrations.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsMonitoringIntegrations.md new file mode 100644 index 00000000..d8ac5cc5 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsMonitoringIntegrations.md @@ -0,0 +1,31 @@ +# AwsMonitoringIntegrations + +A HAL resource containing a list of AWS monitoring integrations and navigation links. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integrations** | [**List[AwsMonitoringIntegration]**](AwsMonitoringIntegration.md) | The list of AWS inventory and flow logs monitoring integrations. | +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integrations import AwsMonitoringIntegrations + +# TODO update the JSON string below +json = "{}" +# create an instance of AwsMonitoringIntegrations from a JSON string +aws_monitoring_integrations_instance = AwsMonitoringIntegrations.from_json(json) +# print the JSON string representation of the object +print(AwsMonitoringIntegrations.to_json()) + +# convert the object into a dict +aws_monitoring_integrations_dict = aws_monitoring_integrations_instance.to_dict() +# create an instance of AwsMonitoringIntegrations from a dict +aws_monitoring_integrations_from_dict = AwsMonitoringIntegrations.from_dict(aws_monitoring_integrations_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/AwsRegion.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsRegion.md new file mode 100644 index 00000000..d8920f4e --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsRegion.md @@ -0,0 +1,12 @@ +# AwsRegion + +AWS region identifier that can be enabled for Cloud Insights inventory monitoring. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/AwsResourceGroupType.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsResourceGroupType.md new file mode 100644 index 00000000..bff9b845 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AwsResourceGroupType.md @@ -0,0 +1,12 @@ +# AwsResourceGroupType + +Supported AWS resource group types that can be toggled within policy settings. Note that ec2 is a mandatory resource group type and will be enabled regardless of user configuration. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/AzureFlowLogsIntegrationRequest.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureFlowLogsIntegrationRequest.md new file mode 100644 index 00000000..61b6f2dc --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureFlowLogsIntegrationRequest.md @@ -0,0 +1,33 @@ +# AzureFlowLogsIntegrationRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the Azure flow logs monitoring integration. | +**app_id** | **str** | The Application (client) ID of the service principal. | +**password** | **str** | The client secret value. | +**azure_tenant_id** | **str** | The Azure Active Directory tenant ID. | +**service_bus_queue_url** | **str** | The URL of the Service Bus Queue. | + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.azure_flow_logs_integration_request import AzureFlowLogsIntegrationRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AzureFlowLogsIntegrationRequest from a JSON string +azure_flow_logs_integration_request_instance = AzureFlowLogsIntegrationRequest.from_json(json) +# print the JSON string representation of the object +print(AzureFlowLogsIntegrationRequest.to_json()) + +# convert the object into a dict +azure_flow_logs_integration_request_dict = azure_flow_logs_integration_request_instance.to_dict() +# create an instance of AzureFlowLogsIntegrationRequest from a dict +azure_flow_logs_integration_request_from_dict = AzureFlowLogsIntegrationRequest.from_dict(azure_flow_logs_integration_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/thousandeyes-sdk-cloud-insights-integrations/docs/AzureIntegrationPolicySetting.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureIntegrationPolicySetting.md new file mode 100644 index 00000000..02c52bb6 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureIntegrationPolicySetting.md @@ -0,0 +1,32 @@ +# AzureIntegrationPolicySetting + +Azure integration policy configuration that defines the monitored Azure resource groups and the subscription policy that ThousandEyes enforces. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled_resource_group_types** | [**List[AzureResourceGroupType]**](AzureResourceGroupType.md) | The set of Azure resource group types included in inventory monitoring. | +**subscriptions_policy** | [**SubscriptionsPolicy**](SubscriptionsPolicy.md) | | +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.azure_integration_policy_setting import AzureIntegrationPolicySetting + +# TODO update the JSON string below +json = "{}" +# create an instance of AzureIntegrationPolicySetting from a JSON string +azure_integration_policy_setting_instance = AzureIntegrationPolicySetting.from_json(json) +# print the JSON string representation of the object +print(AzureIntegrationPolicySetting.to_json()) + +# convert the object into a dict +azure_integration_policy_setting_dict = azure_integration_policy_setting_instance.to_dict() +# create an instance of AzureIntegrationPolicySetting from a dict +azure_integration_policy_setting_from_dict = AzureIntegrationPolicySetting.from_dict(azure_integration_policy_setting_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/AzureInventoryIntegrationRequest.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureInventoryIntegrationRequest.md new file mode 100644 index 00000000..13c09465 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureInventoryIntegrationRequest.md @@ -0,0 +1,32 @@ +# AzureInventoryIntegrationRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the Azure inventory monitoring integration. | +**app_id** | **str** | The Application (client) ID of the service principal. | +**password** | **str** | The client secret value. | +**azure_tenant_id** | **str** | The Azure Active Directory tenant ID. | + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.azure_inventory_integration_request import AzureInventoryIntegrationRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AzureInventoryIntegrationRequest from a JSON string +azure_inventory_integration_request_instance = AzureInventoryIntegrationRequest.from_json(json) +# print the JSON string representation of the object +print(AzureInventoryIntegrationRequest.to_json()) + +# convert the object into a dict +azure_inventory_integration_request_dict = azure_inventory_integration_request_instance.to_dict() +# create an instance of AzureInventoryIntegrationRequest from a dict +azure_inventory_integration_request_from_dict = AzureInventoryIntegrationRequest.from_dict(azure_inventory_integration_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/thousandeyes-sdk-cloud-insights-integrations/docs/AzureMonitoringIntegration.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureMonitoringIntegration.md new file mode 100644 index 00000000..54323e2d --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureMonitoringIntegration.md @@ -0,0 +1,36 @@ +# AzureMonitoringIntegration + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique ID for the Azure inventory or flow logs monitoring integration. | +**name** | **str** | The name of the Azure inventory or flow logs monitoring integration. | +**app_id** | **str** | The Application (client) ID of the service principal. | +**password** | **str** | The client secret value. For security reasons, the client secret value is masked. | +**azure_tenant_id** | **str** | The Azure Active Directory tenant ID. | +**service_bus_queue_url** | **str** | The URL of the Service Bus Queue. Relevant only for flow logs monitoring integrations. | [optional] +**monitoring_type** | **str** | The type of monitoring integration. | +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integration import AzureMonitoringIntegration + +# TODO update the JSON string below +json = "{}" +# create an instance of AzureMonitoringIntegration from a JSON string +azure_monitoring_integration_instance = AzureMonitoringIntegration.from_json(json) +# print the JSON string representation of the object +print(AzureMonitoringIntegration.to_json()) + +# convert the object into a dict +azure_monitoring_integration_dict = azure_monitoring_integration_instance.to_dict() +# create an instance of AzureMonitoringIntegration from a dict +azure_monitoring_integration_from_dict = AzureMonitoringIntegration.from_dict(azure_monitoring_integration_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/AzureMonitoringIntegrations.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureMonitoringIntegrations.md new file mode 100644 index 00000000..e1502b34 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureMonitoringIntegrations.md @@ -0,0 +1,31 @@ +# AzureMonitoringIntegrations + +A HAL resource containing a list of Azure inventory and flow logs monitoring integrations. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integrations** | [**List[AzureMonitoringIntegration]**](AzureMonitoringIntegration.md) | The list of Azure inventory and flow logs monitoring integrations. | +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integrations import AzureMonitoringIntegrations + +# TODO update the JSON string below +json = "{}" +# create an instance of AzureMonitoringIntegrations from a JSON string +azure_monitoring_integrations_instance = AzureMonitoringIntegrations.from_json(json) +# print the JSON string representation of the object +print(AzureMonitoringIntegrations.to_json()) + +# convert the object into a dict +azure_monitoring_integrations_dict = azure_monitoring_integrations_instance.to_dict() +# create an instance of AzureMonitoringIntegrations from a dict +azure_monitoring_integrations_from_dict = AzureMonitoringIntegrations.from_dict(azure_monitoring_integrations_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/AzureResourceGroupType.md b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureResourceGroupType.md new file mode 100644 index 00000000..476b9eca --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/AzureResourceGroupType.md @@ -0,0 +1,12 @@ +# AzureResourceGroupType + +Supported Azure resource group types that can be toggled within policy settings. Note that networking is a mandatory resource group type and will be enabled regardless of user configuration. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationPolicySettingsApi.md b/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationPolicySettingsApi.md new file mode 100644 index 00000000..fbc2fc95 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationPolicySettingsApi.md @@ -0,0 +1,350 @@ +# thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationPolicySettingsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_aws_integration_policy_settings**](CloudInsightsIntegrationPolicySettingsApi.md#get_aws_integration_policy_settings) | **GET** /cloud-insights/integration/aws/policy/settings | Get AWS integration policy settings +[**get_azure_integration_policy_settings**](CloudInsightsIntegrationPolicySettingsApi.md#get_azure_integration_policy_settings) | **GET** /cloud-insights/integration/azure/policy/settings | Get Azure integration policy settings +[**update_aws_integration_policy_settings**](CloudInsightsIntegrationPolicySettingsApi.md#update_aws_integration_policy_settings) | **PUT** /cloud-insights/integration/aws/policy/settings | Update AWS integration policy settings +[**update_azure_integration_policy_settings**](CloudInsightsIntegrationPolicySettingsApi.md#update_azure_integration_policy_settings) | **PUT** /cloud-insights/integration/azure/policy/settings | Update Azure integration policy settings + + +# **get_aws_integration_policy_settings** +> AwsIntegrationPolicySetting get_aws_integration_policy_settings(aid=aid) + +Get AWS integration policy settings + +Retrieves the AWS integration policy settings for the authenticated account group. Use this endpoint to audit which AWS resource group types and AWS regions are enabled, and whether CloudTrail is enabled, for Cloud Insights inventory monitoring. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.aws_integration_policy_setting import AwsIntegrationPolicySetting +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationPolicySettingsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get AWS integration policy settings + api_response = api_instance.get_aws_integration_policy_settings(aid=aid) + print("The response of CloudInsightsIntegrationPolicySettingsApi->get_aws_integration_policy_settings:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationPolicySettingsApi->get_aws_integration_policy_settings: %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 + +[**AwsIntegrationPolicySetting**](AwsIntegrationPolicySetting.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** | AWS integration policy settings returned successfully. | - | +**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_azure_integration_policy_settings** +> AzureIntegrationPolicySetting get_azure_integration_policy_settings(aid=aid) + +Get Azure integration policy settings + +Retrieves the Azure integration policy settings for the authenticated account group. Use this endpoint to review which Azure resource group types are monitored and inspect the subscriptions policy rules that gate which subscriptions ThousandEyes inventories. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.azure_integration_policy_setting import AzureIntegrationPolicySetting +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationPolicySettingsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get Azure integration policy settings + api_response = api_instance.get_azure_integration_policy_settings(aid=aid) + print("The response of CloudInsightsIntegrationPolicySettingsApi->get_azure_integration_policy_settings:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationPolicySettingsApi->get_azure_integration_policy_settings: %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 + +[**AzureIntegrationPolicySetting**](AzureIntegrationPolicySetting.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** | Azure integration policy settings returned successfully. | - | +**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_aws_integration_policy_settings** +> AwsIntegrationPolicySetting update_aws_integration_policy_settings(aws_integration_policy_setting, aid=aid) + +Update AWS integration policy settings + +Updates the AWS integration policy settings for the authenticated account group. This endpoint lets you enable or disable specific AWS resource group types, adjust the set of AWS regions to inventory, and control whether CloudTrail is enabled for inventory monitoring. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.aws_integration_policy_setting import AwsIntegrationPolicySetting +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationPolicySettingsApi(api_client) + aws_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.AwsIntegrationPolicySetting() # AwsIntegrationPolicySetting | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Update AWS integration policy settings + api_response = api_instance.update_aws_integration_policy_settings(aws_integration_policy_setting, aid=aid) + print("The response of CloudInsightsIntegrationPolicySettingsApi->update_aws_integration_policy_settings:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationPolicySettingsApi->update_aws_integration_policy_settings: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aws_integration_policy_setting** | [**AwsIntegrationPolicySetting**](AwsIntegrationPolicySetting.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 + +[**AwsIntegrationPolicySetting**](AwsIntegrationPolicySetting.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** | AWS integration policy settings updated successfully. | - | +**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_azure_integration_policy_settings** +> AzureIntegrationPolicySetting update_azure_integration_policy_settings(azure_integration_policy_setting, aid=aid) + +Update Azure integration policy settings + +Updates the Azure integration policy settings for the authenticated account group. This endpoint lets you enable or disable Azure resource group types and manage the subscriptions policy (rules plus default action) that controls which Azure subscriptions are inventoried. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.azure_integration_policy_setting import AzureIntegrationPolicySetting +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationPolicySettingsApi(api_client) + azure_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.AzureIntegrationPolicySetting() # AzureIntegrationPolicySetting | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Update Azure integration policy settings + api_response = api_instance.update_azure_integration_policy_settings(azure_integration_policy_setting, aid=aid) + print("The response of CloudInsightsIntegrationPolicySettingsApi->update_azure_integration_policy_settings:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationPolicySettingsApi->update_azure_integration_policy_settings: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **azure_integration_policy_setting** | [**AzureIntegrationPolicySetting**](AzureIntegrationPolicySetting.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 + +[**AzureIntegrationPolicySetting**](AzureIntegrationPolicySetting.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** | Azure integration policy settings updated successfully. | - | +**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/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md b/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md new file mode 100644 index 00000000..0131932d --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/CloudInsightsIntegrationsApi.md @@ -0,0 +1,1212 @@ +# thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_aws_flow_logs_monitoring_integration**](CloudInsightsIntegrationsApi.md#create_aws_flow_logs_monitoring_integration) | **POST** /cloud-insights/integration/aws/flow-logs | Create AWS flow logs monitoring integration +[**create_aws_inventory_monitoring_integration**](CloudInsightsIntegrationsApi.md#create_aws_inventory_monitoring_integration) | **POST** /cloud-insights/integration/aws/inventory | Create AWS inventory monitoring integration +[**create_azure_flow_logs_monitoring_integration**](CloudInsightsIntegrationsApi.md#create_azure_flow_logs_monitoring_integration) | **POST** /cloud-insights/integration/azure/flow-logs | Create Azure flow logs monitoring integration +[**create_azure_inventory_monitoring_integration**](CloudInsightsIntegrationsApi.md#create_azure_inventory_monitoring_integration) | **POST** /cloud-insights/integration/azure/inventory | Create Azure inventory monitoring integration +[**delete_aws_monitoring_integration**](CloudInsightsIntegrationsApi.md#delete_aws_monitoring_integration) | **DELETE** /cloud-insights/integration/aws/{integrationId} | Delete AWS integration +[**delete_azure_monitoring_integration**](CloudInsightsIntegrationsApi.md#delete_azure_monitoring_integration) | **DELETE** /cloud-insights/integration/azure/{integrationId} | Delete Azure integration +[**get_all_aws_monitoring_integrations**](CloudInsightsIntegrationsApi.md#get_all_aws_monitoring_integrations) | **GET** /cloud-insights/integration/aws | List AWS integrations +[**get_all_azure_monitoring_integrations**](CloudInsightsIntegrationsApi.md#get_all_azure_monitoring_integrations) | **GET** /cloud-insights/integration/azure | List Azure integrations +[**get_aws_flowlogs_monitoring_integration_policies**](CloudInsightsIntegrationsApi.md#get_aws_flowlogs_monitoring_integration_policies) | **GET** /cloud-insights/integration/aws/flow-logs/policies | Get AWS flow logs monitoring IAM policies +[**get_aws_inventory_monitoring_integration_policies**](CloudInsightsIntegrationsApi.md#get_aws_inventory_monitoring_integration_policies) | **GET** /cloud-insights/integration/aws/inventory/policies | Get AWS inventory monitoring IAM policies +[**get_aws_monitoring_integration**](CloudInsightsIntegrationsApi.md#get_aws_monitoring_integration) | **GET** /cloud-insights/integration/aws/{integrationId} | Get AWS integration +[**get_azure_monitoring_integration**](CloudInsightsIntegrationsApi.md#get_azure_monitoring_integration) | **GET** /cloud-insights/integration/azure/{integrationId} | Get Azure integration +[**update_azure_flow_logs_monitoring_integration**](CloudInsightsIntegrationsApi.md#update_azure_flow_logs_monitoring_integration) | **PUT** /cloud-insights/integration/azure/flow-logs/{integrationId} | Update Azure flow logs monitoring integration +[**update_azure_inventory_monitoring_integration**](CloudInsightsIntegrationsApi.md#update_azure_inventory_monitoring_integration) | **PUT** /cloud-insights/integration/azure/inventory/{integrationId} | Update Azure inventory monitoring integration + + +# **create_aws_flow_logs_monitoring_integration** +> AwsMonitoringIntegration create_aws_flow_logs_monitoring_integration(aws_flow_logs_integration_request, aid=aid) + +Create AWS flow logs monitoring integration + +Creates a new AWS flow logs monitoring integration. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.aws_flow_logs_integration_request import AwsFlowLogsIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integration import AwsMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + aws_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.AwsFlowLogsIntegrationRequest() # AwsFlowLogsIntegrationRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create AWS flow logs monitoring integration + api_response = api_instance.create_aws_flow_logs_monitoring_integration(aws_flow_logs_integration_request, aid=aid) + print("The response of CloudInsightsIntegrationsApi->create_aws_flow_logs_monitoring_integration:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->create_aws_flow_logs_monitoring_integration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aws_flow_logs_integration_request** | [**AwsFlowLogsIntegrationRequest**](AwsFlowLogsIntegrationRequest.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 + +[**AwsMonitoringIntegration**](AwsMonitoringIntegration.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** | AWS flow logs monitoring integration created successfully. | - | +**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) + +# **create_aws_inventory_monitoring_integration** +> AwsMonitoringIntegration create_aws_inventory_monitoring_integration(aws_inventory_integration_request, aid=aid) + +Create AWS inventory monitoring integration + +Creates a new AWS inventory monitoring integration. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.aws_inventory_integration_request import AwsInventoryIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integration import AwsMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + aws_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.AwsInventoryIntegrationRequest() # AwsInventoryIntegrationRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create AWS inventory monitoring integration + api_response = api_instance.create_aws_inventory_monitoring_integration(aws_inventory_integration_request, aid=aid) + print("The response of CloudInsightsIntegrationsApi->create_aws_inventory_monitoring_integration:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->create_aws_inventory_monitoring_integration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aws_inventory_integration_request** | [**AwsInventoryIntegrationRequest**](AwsInventoryIntegrationRequest.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 + +[**AwsMonitoringIntegration**](AwsMonitoringIntegration.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** | AWS inventory monitoring integration created successfully. | - | +**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) + +# **create_azure_flow_logs_monitoring_integration** +> AzureMonitoringIntegration create_azure_flow_logs_monitoring_integration(azure_flow_logs_integration_request, aid=aid) + +Create Azure flow logs monitoring integration + +Creates a new Azure flow logs monitoring integration. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.azure_flow_logs_integration_request import AzureFlowLogsIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integration import AzureMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.AzureFlowLogsIntegrationRequest() # AzureFlowLogsIntegrationRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create Azure flow logs monitoring integration + api_response = api_instance.create_azure_flow_logs_monitoring_integration(azure_flow_logs_integration_request, aid=aid) + print("The response of CloudInsightsIntegrationsApi->create_azure_flow_logs_monitoring_integration:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->create_azure_flow_logs_monitoring_integration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **azure_flow_logs_integration_request** | [**AzureFlowLogsIntegrationRequest**](AzureFlowLogsIntegrationRequest.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 + +[**AzureMonitoringIntegration**](AzureMonitoringIntegration.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** | Azure flow logs monitoring integration created successfully. | - | +**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) + +# **create_azure_inventory_monitoring_integration** +> AzureMonitoringIntegration create_azure_inventory_monitoring_integration(azure_inventory_integration_request, aid=aid) + +Create Azure inventory monitoring integration + +Creates a new Azure inventory monitoring integration. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.azure_inventory_integration_request import AzureInventoryIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integration import AzureMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.AzureInventoryIntegrationRequest() # AzureInventoryIntegrationRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Create Azure inventory monitoring integration + api_response = api_instance.create_azure_inventory_monitoring_integration(azure_inventory_integration_request, aid=aid) + print("The response of CloudInsightsIntegrationsApi->create_azure_inventory_monitoring_integration:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->create_azure_inventory_monitoring_integration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **azure_inventory_integration_request** | [**AzureInventoryIntegrationRequest**](AzureInventoryIntegrationRequest.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 + +[**AzureMonitoringIntegration**](AzureMonitoringIntegration.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** | Azure inventory monitoring integration created successfully. | - | +**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_aws_monitoring_integration** +> delete_aws_monitoring_integration(integration_id, aid=aid) + +Delete AWS integration + +Deletes a specific AWS inventory or flow logs monitoring integration using the AWS integration ID. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' # str | The unique ID of the AWS or Azure inventory or flow logs monitoring integration. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete AWS integration + api_instance.delete_aws_monitoring_integration(integration_id, aid=aid) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->delete_aws_monitoring_integration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_id** | **str**| The unique ID of the AWS or Azure inventory or flow logs monitoring integration. | + **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) + +# **delete_azure_monitoring_integration** +> delete_azure_monitoring_integration(integration_id, aid=aid) + +Delete Azure integration + +Deletes a specific Azure inventory or flow logs monitoring integration using the Azure integration ID. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' # str | The unique ID of the AWS or Azure inventory or flow logs monitoring integration. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Delete Azure integration + api_instance.delete_azure_monitoring_integration(integration_id, aid=aid) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->delete_azure_monitoring_integration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_id** | **str**| The unique ID of the AWS or Azure inventory or flow logs monitoring integration. | + **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_all_aws_monitoring_integrations** +> AwsMonitoringIntegrations get_all_aws_monitoring_integrations(aid=aid) + +List AWS integrations + +Retrieves all AWS inventory and flow logs monitoring integrations configured for the authenticated account group in ThousandEyes. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integrations import AwsMonitoringIntegrations +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List AWS integrations + api_response = api_instance.get_all_aws_monitoring_integrations(aid=aid) + print("The response of CloudInsightsIntegrationsApi->get_all_aws_monitoring_integrations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->get_all_aws_monitoring_integrations: %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 + +[**AwsMonitoringIntegrations**](AwsMonitoringIntegrations.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** | The response is an array of integration objects, where each object represents either an Inventory Monitoring or Flow Logs Monitoring integration. Each integration includes metadata such as: id — the unique identifier of the integration; name — the user-defined name of the integration; roleArn — the AWS IAM role ARN that ThousandEyes assumes to access your AWS resources; externalId — the external identifier used for secure cross-account role assumption; monitoringType — specifies whether the integration monitors AWS inventory (inventory-monitoring) or flow logs (flow-logs-monitoring); snsTopicsArns — a list of SNS topic ARNs used for flow logs monitoring (only present for flow logs monitoring integrations); links — HAL-style link relations that provide the \"self\" URL for retrieving integration details. This endpoint can be used to: audit all existing AWS integrations configured for Cloud Insights, identify which integrations are set up for inventory versus flow logs monitoring, and retrieve integration IDs for further API operations such as inspection (GET /cloud-insights/integration/aws/{integrationId}) or deletion (DELETE). The response is returned as a JSON array conforming to the AwsMonitoringIntegration schema. | - | +**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_all_azure_monitoring_integrations** +> AzureMonitoringIntegrations get_all_azure_monitoring_integrations(aid=aid) + +List Azure integrations + +Retrieves all Azure inventory and flow logs monitoring integrations configured for the authenticated account group in ThousandEyes. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integrations import AzureMonitoringIntegrations +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # List Azure integrations + api_response = api_instance.get_all_azure_monitoring_integrations(aid=aid) + print("The response of CloudInsightsIntegrationsApi->get_all_azure_monitoring_integrations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->get_all_azure_monitoring_integrations: %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 + +[**AzureMonitoringIntegrations**](AzureMonitoringIntegrations.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** | The response is an array of integration objects, where each object represents either an Azure Inventory Monitoring or Azure Flow Logs Monitoring integration. Each integration includes metadata such as: id — the unique identifier of the integration; name — the user-defined name of the integration; appId / clientId — the Azure Application (client) ID of the service principal used for authentication; password / clientSecret — the client secret value associated with the service principal (note: for security reasons, the actual secret is never returned. The response includes a masked value (\"********\") instead); azureTenantId — the Azure Active Directory tenant ID associated with the integration; serviceBusQueueUrl — the Service Bus queue URL used for flow logs monitoring (only present for azure-flow-logs-monitoring integrations); monitoringType — specifies whether the integration monitors Azure resources (azure-inventory-monitoring) or Azure flow logs (azure-flow-logs-monitoring); links — HAL-style link relations that provide the \"self\" URL for retrieving integration details. This endpoint can be used to: audit all existing Azure integrations configured for Cloud Insights, identify which integrations are configured for inventory versus flow logs monitoring, and retrieve integration IDs for further API operations such as inspection (GET /cloud-insights/integration/azure/{integrationId}) or deletion (DELETE). The response is returned as a JSON array conforming to the AwsMonitoringIntegration schema. | - | +**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_aws_flowlogs_monitoring_integration_policies** +> str get_aws_flowlogs_monitoring_integration_policies(aid=aid) + +Get AWS flow logs monitoring IAM policies + +Retrieves the AWS IAM policies required to configure an AWS flow logs monitoring integration in JSON string format for the authenticated account group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get AWS flow logs monitoring IAM policies + api_response = api_instance.get_aws_flowlogs_monitoring_integration_policies(aid=aid) + print("The response of CloudInsightsIntegrationsApi->get_aws_flowlogs_monitoring_integration_policies:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->get_aws_flowlogs_monitoring_integration_policies: %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 + +**str** + +### 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** | The response contains a JSON object with the following policy documents under the policies key: 1) Trusted Policy — defines the trust relationship that allows ThousandEyes to assume a specified AWS IAM role via sts:AssumeRole. This includes the Principal ARN for ThousandEyes and the required ExternalId condition for secure cross-account access; 2) Permissions Policy — grants ThousandEyes read-only access to the Amazon S3 buckets where flow logs are stored. The policy includes permissions such as s3:GetObject and s3:ListBucket, scoped to the relevant flow log S3 bucket ARNs; 3) SNS Topic Access Policy — allows ThousandEyes to subscribe to Amazon SNS topics that receive flow log delivery notifications. It also enables the S3 service to publish events to those topics, ensuring ThousandEyes can be notified of new log data. This policy includes permissions for both SNS:Subscribe (for ThousandEyes) and SNS:Publish (for S3 event notifications). Use these policies when configuring the IAM role and SNS topic permissions required by ThousandEyes Cloud Insights to collect and monitor AWS flow logs data across your account. The response is returned as a JSON string in the policies object. | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**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_aws_inventory_monitoring_integration_policies** +> str get_aws_inventory_monitoring_integration_policies(aid=aid) + +Get AWS inventory monitoring IAM policies + +Retrieves the AWS IAM policies required to configure an AWS inventory monitoring integration in JSON string format for the authenticated account group. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get AWS inventory monitoring IAM policies + api_response = api_instance.get_aws_inventory_monitoring_integration_policies(aid=aid) + print("The response of CloudInsightsIntegrationsApi->get_aws_inventory_monitoring_integration_policies:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->get_aws_inventory_monitoring_integration_policies: %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 + +**str** + +### 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** | The response includes a JSON object containing two key policy documents: 1) Trusted Policy — defines the trust relationship that allows ThousandEyes to assume a specified AWS IAM role through sts:AssumeRole. This policy includes the Principal ARN for ThousandEyes and the required ExternalId condition; 2) Permissions Policy — lists the AWS service-level read permissions needed by ThousandEyes Cloud Insights to inventory network resources. These permissions cover services such as EC2, VPC, Transit Gateway, Direct Connect, CloudFront, ELB, CloudTrail, ECS/EKS, and S3. Use these policies when creating or updating the IAM role that ThousandEyes will use for inventory monitoring. The response is returned as a JSON string in the policies object. | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**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_aws_monitoring_integration** +> AwsMonitoringIntegration get_aws_monitoring_integration(integration_id, aid=aid) + +Get AWS integration + +Retrieves details for a specific AWS inventory or flow logs monitoring integration associated with the authenticated account group using the unique integration ID. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integration import AwsMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' # str | The unique ID of the AWS or Azure inventory or flow logs monitoring integration. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get AWS integration + api_response = api_instance.get_aws_monitoring_integration(integration_id, aid=aid) + print("The response of CloudInsightsIntegrationsApi->get_aws_monitoring_integration:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->get_aws_monitoring_integration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_id** | **str**| The unique ID of the AWS or Azure inventory or flow logs monitoring integration. | + **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 + +[**AwsMonitoringIntegration**](AwsMonitoringIntegration.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** | The response contains a single integration object representing either: AWS inventory monitoring integration or AWS flow logs monitoring integration. Each integration includes metadata that defines its configuration: id — the unique identifier of the integration; name — the user-defined name of the integration; roleArn — the AWS IAM role ARN that ThousandEyes assumes to access your AWS resources; externalId — the external identifier used for secure cross-account role assumption; monitoringType — identifies whether the integration monitors AWS inventory (inventory-monitoring) or flow logs (flow-logs-monitoring); snsTopicsArns — a list of SNS topic ARNs associated with flow logs monitoring (only present for flow-logs-monitoring integrations); links — HAL-style link relations that include a self URL pointing to this integration resource. This endpoint is typically used to: retrieve detailed configuration information for a specific AWS integration, verify that the integration is correctly set up and associated with the expected AWS IAM role, and obtain integration details before performing deletion or troubleshooting operations. | - | +**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_azure_monitoring_integration** +> AzureMonitoringIntegration get_azure_monitoring_integration(integration_id, aid=aid) + +Get Azure integration + +Retrieves details for a specific Azure inventory or flow logs monitoring integration associated with the authenticated account group using the unique integration ID. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integration import AzureMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' # str | The unique ID of the AWS or Azure inventory or flow logs monitoring integration. + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Get Azure integration + api_response = api_instance.get_azure_monitoring_integration(integration_id, aid=aid) + print("The response of CloudInsightsIntegrationsApi->get_azure_monitoring_integration:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->get_azure_monitoring_integration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_id** | **str**| The unique ID of the AWS or Azure inventory or flow logs monitoring integration. | + **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 + +[**AzureMonitoringIntegration**](AzureMonitoringIntegration.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** | The response contains a single integration object representing either: Azure Inventory Monitoring integration or Azure Flow Logs Monitoring integration. Each integration includes metadata that defines its configuration: id — the unique identifier of the integration; name — the user-defined name of the integration; appId / clientId — the Azure Application (client) ID of the service principal used for authentication; password / clientSecret — the client secret value associated with the service principal (note: for security reasons, the actual secret is never returned. The response includes a masked value (\"********\") instead; azureTenantId — the Azure Active Directory tenant ID for the integration; serviceBusQueueUrl — the Service Bus queue URL used for receiving Flow Logs (only present for azure-flow-logs-monitoring integrations); monitoringType — identifies whether the integration monitors Azure resources (azure-inventory-monitoring) or flow logs (azure-flow-logs-monitoring); links — HAL-style link relations that include a \"self\" URL pointing to this integration resource. This endpoint is typically used to: retrieve detailed configuration information for a specific Azure integration, validate that the integration credentials and type (inventory or flow logs) are correctly configured, and obtain integration details before performing update or deletion operations. | - | +**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_azure_flow_logs_monitoring_integration** +> AzureMonitoringIntegration update_azure_flow_logs_monitoring_integration(integration_id, azure_flow_logs_integration_request, aid=aid) + +Update Azure flow logs monitoring integration + +Updates an existing Azure flow logs monitoring integration. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.azure_flow_logs_integration_request import AzureFlowLogsIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integration import AzureMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' # str | The unique ID of the AWS or Azure inventory or flow logs monitoring integration. + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.AzureFlowLogsIntegrationRequest() # AzureFlowLogsIntegrationRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Update Azure flow logs monitoring integration + api_response = api_instance.update_azure_flow_logs_monitoring_integration(integration_id, azure_flow_logs_integration_request, aid=aid) + print("The response of CloudInsightsIntegrationsApi->update_azure_flow_logs_monitoring_integration:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->update_azure_flow_logs_monitoring_integration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_id** | **str**| The unique ID of the AWS or Azure inventory or flow logs monitoring integration. | + **azure_flow_logs_integration_request** | [**AzureFlowLogsIntegrationRequest**](AzureFlowLogsIntegrationRequest.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 + +[**AzureMonitoringIntegration**](AzureMonitoringIntegration.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** | Azure flow logs monitoring integration updated successfully. | - | +**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_azure_inventory_monitoring_integration** +> AzureMonitoringIntegration update_azure_inventory_monitoring_integration(integration_id, azure_inventory_integration_request, aid=aid) + +Update Azure inventory monitoring integration + +Updates an existing Azure inventory monitoring integration. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.cloud_insights_integrations +from thousandeyes_sdk.cloud_insights_integrations.models.azure_inventory_integration_request import AzureInventoryIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integration import AzureMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.thousandeyes.com/v7 +# See configuration.py for a list of all supported configuration parameters. +configuration = thousandeyes_sdk.core.Configuration( + host = "https://api.thousandeyes.com/v7" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: BearerAuth +configuration = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.cloud_insights_integrations.CloudInsightsIntegrationsApi(api_client) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' # str | The unique ID of the AWS or Azure inventory or flow logs monitoring integration. + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.AzureInventoryIntegrationRequest() # AzureInventoryIntegrationRequest | + aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional) + + try: + # Update Azure inventory monitoring integration + api_response = api_instance.update_azure_inventory_monitoring_integration(integration_id, azure_inventory_integration_request, aid=aid) + print("The response of CloudInsightsIntegrationsApi->update_azure_inventory_monitoring_integration:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling CloudInsightsIntegrationsApi->update_azure_inventory_monitoring_integration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integration_id** | **str**| The unique ID of the AWS or Azure inventory or flow logs monitoring integration. | + **azure_inventory_integration_request** | [**AzureInventoryIntegrationRequest**](AzureInventoryIntegrationRequest.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 + +[**AzureMonitoringIntegration**](AzureMonitoringIntegration.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** | Azure inventory monitoring integration updated successfully. | - | +**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/thousandeyes-sdk-cloud-insights-integrations/docs/Error.md b/thousandeyes-sdk-cloud-insights-integrations/docs/Error.md new file mode 100644 index 00000000..d872261a --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/Error.md @@ -0,0 +1,33 @@ +# Error + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print(Error.to_json()) + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_from_dict = Error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/Link.md b/thousandeyes-sdk-cloud-insights-integrations/docs/Link.md new file mode 100644 index 00000000..4e9c434d --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/Link.md @@ -0,0 +1,37 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print(Link.to_json()) + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_from_dict = Link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/SelfLinks.md b/thousandeyes-sdk-cloud-insights-integrations/docs/SelfLinks.md new file mode 100644 index 00000000..38ae3a24 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/SelfLinks.md @@ -0,0 +1,30 @@ +# SelfLinks + +A links object containing the self link. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print(SelfLinks.to_json()) + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_from_dict = SelfLinks.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicy.md b/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicy.md new file mode 100644 index 00000000..7715d4b5 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicy.md @@ -0,0 +1,31 @@ +# SubscriptionsPolicy + +Policy document that controls which Azure subscriptions are inventoried. Up to 10 rules can be provided. Rules are evaluated in order; if none match, the defaultAction is applied. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rules** | [**List[SubscriptionsPolicyRule]**](SubscriptionsPolicyRule.md) | Ordered list of subscription policy rules. Maximum of 10 entries. | +**default_action** | [**SubscriptionsPolicyRuleAction**](SubscriptionsPolicyRuleAction.md) | | + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy import SubscriptionsPolicy + +# TODO update the JSON string below +json = "{}" +# create an instance of SubscriptionsPolicy from a JSON string +subscriptions_policy_instance = SubscriptionsPolicy.from_json(json) +# print the JSON string representation of the object +print(SubscriptionsPolicy.to_json()) + +# convert the object into a dict +subscriptions_policy_dict = subscriptions_policy_instance.to_dict() +# create an instance of SubscriptionsPolicy from a dict +subscriptions_policy_from_dict = SubscriptionsPolicy.from_dict(subscriptions_policy_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRule.md b/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRule.md new file mode 100644 index 00000000..996e4d41 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRule.md @@ -0,0 +1,32 @@ +# SubscriptionsPolicyRule + +A single subscription rule consisting of a field, pattern, and action. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_field** | [**SubscriptionsPolicyRuleField**](SubscriptionsPolicyRuleField.md) | | +**pattern** | **str** | String or regular expression used to match subscription identifiers or names. | +**action** | [**SubscriptionsPolicyRuleAction**](SubscriptionsPolicyRuleAction.md) | | + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy_rule import SubscriptionsPolicyRule + +# TODO update the JSON string below +json = "{}" +# create an instance of SubscriptionsPolicyRule from a JSON string +subscriptions_policy_rule_instance = SubscriptionsPolicyRule.from_json(json) +# print the JSON string representation of the object +print(SubscriptionsPolicyRule.to_json()) + +# convert the object into a dict +subscriptions_policy_rule_dict = subscriptions_policy_rule_instance.to_dict() +# create an instance of SubscriptionsPolicyRule from a dict +subscriptions_policy_rule_from_dict = SubscriptionsPolicyRule.from_dict(subscriptions_policy_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/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRuleAction.md b/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRuleAction.md new file mode 100644 index 00000000..7c2db8b1 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRuleAction.md @@ -0,0 +1,12 @@ +# SubscriptionsPolicyRuleAction + +Action applied when a subscriptions policy rule matches. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRuleField.md b/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRuleField.md new file mode 100644 index 00000000..4bb5463c --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/SubscriptionsPolicyRuleField.md @@ -0,0 +1,12 @@ +# SubscriptionsPolicyRuleField + +Identifies whether the rule evaluates subscription IDs or subscription names. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/UnauthorizedError.md b/thousandeyes-sdk-cloud-insights-integrations/docs/UnauthorizedError.md new file mode 100644 index 00000000..91f73f74 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/UnauthorizedError.md @@ -0,0 +1,30 @@ +# UnauthorizedError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print(UnauthorizedError.to_json()) + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_from_dict = UnauthorizedError.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/ValidationError.md b/thousandeyes-sdk-cloud-insights-integrations/docs/ValidationError.md new file mode 100644 index 00000000..95b03aa4 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/ValidationError.md @@ -0,0 +1,34 @@ +# ValidationError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] +**errors** | [**List[ValidationErrorItem]**](ValidationErrorItem.md) | (Optional) When multiple errors occur, the details for each error are listed. | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.validation_error import ValidationError + +# TODO update the JSON string below +json = "{}" +# create an instance of ValidationError from a JSON string +validation_error_instance = ValidationError.from_json(json) +# print the JSON string representation of the object +print(ValidationError.to_json()) + +# convert the object into a dict +validation_error_dict = validation_error_instance.to_dict() +# create an instance of ValidationError from a dict +validation_error_from_dict = ValidationError.from_dict(validation_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/docs/ValidationErrorItem.md b/thousandeyes-sdk-cloud-insights-integrations/docs/ValidationErrorItem.md new file mode 100644 index 00000000..988c7be7 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/docs/ValidationErrorItem.md @@ -0,0 +1,31 @@ +# ValidationErrorItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | (Optional) A unique error type/code that can be referenced in the documentation for further details. | [optional] +**var_field** | **str** | Identifies the field that triggered this particular error. | [optional] +**message** | **str** | A short, human-readable summary of the error. | [optional] + +## Example + +```python +from thousandeyes_sdk.cloud_insights_integrations.models.validation_error_item import ValidationErrorItem + +# TODO update the JSON string below +json = "{}" +# create an instance of ValidationErrorItem from a JSON string +validation_error_item_instance = ValidationErrorItem.from_json(json) +# print the JSON string representation of the object +print(ValidationErrorItem.to_json()) + +# convert the object into a dict +validation_error_item_dict = validation_error_item_instance.to_dict() +# create an instance of ValidationErrorItem from a dict +validation_error_item_from_dict = ValidationErrorItem.from_dict(validation_error_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/pyproject.toml b/thousandeyes-sdk-cloud-insights-integrations/pyproject.toml new file mode 100644 index 00000000..4a16c0bf --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/pyproject.toml @@ -0,0 +1,82 @@ +[project] +name = "thousandeyes-sdk-cloud-insights-integrations" +dynamic = ["version"] +readme = "README.md" +authors = [ + { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } +] +description = "ThousandEyes SDK Cloud Insights Integrations API" +license = { file = "LICENSE" } +requires-python = ">= 3.9" +dependencies = [ + "urllib3 >= 2.6.3", + "python-dateutil >=2.8.2", + "pydantic >=2.1.0", + "typing-extensions >=4.7.1", + "thousandeyes-sdk-core", +] + +[tool.setuptools.dynamic] +version = {file = ".version"} + +[project.optional-dependencies] +test = [ + "pytest~=7.1.3", + "pytest-cov>=2.8.1", + "pytest-randomly>=3.12.0", + "mypy>=1.4.1", + "types-python-dateutil>=2.8.19", +] +dev = [ + "flake8>=4.0.0", + "mypy>=1.4.1", + "types-python-dateutil>=2.8.19", +] + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +include-package-data = true + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "src", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/thousandeyes-sdk-cloud-insights-integrations/setup.cfg b/thousandeyes-sdk-cloud-insights-integrations/setup.cfg new file mode 100644 index 00000000..11433ee8 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/__init__.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/__init__.py new file mode 100644 index 00000000..f53f834c --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/__init__.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import apis into sdk package +from thousandeyes_sdk.cloud_insights_integrations.api.cloud_insights_integration_policy_settings_api import CloudInsightsIntegrationPolicySettingsApi +from thousandeyes_sdk.cloud_insights_integrations.api.cloud_insights_integrations_api import CloudInsightsIntegrationsApi + + +# import models into sdk package +from thousandeyes_sdk.cloud_insights_integrations.models.aws_flow_logs_integration_request import AwsFlowLogsIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.aws_integration_policy_setting import AwsIntegrationPolicySetting +from thousandeyes_sdk.cloud_insights_integrations.models.aws_inventory_integration_request import AwsInventoryIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integration import AwsMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integrations import AwsMonitoringIntegrations +from thousandeyes_sdk.cloud_insights_integrations.models.aws_region import AwsRegion +from thousandeyes_sdk.cloud_insights_integrations.models.aws_resource_group_type import AwsResourceGroupType +from thousandeyes_sdk.cloud_insights_integrations.models.azure_flow_logs_integration_request import AzureFlowLogsIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.azure_integration_policy_setting import AzureIntegrationPolicySetting +from thousandeyes_sdk.cloud_insights_integrations.models.azure_inventory_integration_request import AzureInventoryIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integration import AzureMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integrations import AzureMonitoringIntegrations +from thousandeyes_sdk.cloud_insights_integrations.models.azure_resource_group_type import AzureResourceGroupType +from thousandeyes_sdk.cloud_insights_integrations.models.error import Error +from thousandeyes_sdk.cloud_insights_integrations.models.link import Link +from thousandeyes_sdk.cloud_insights_integrations.models.self_links import SelfLinks +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy import SubscriptionsPolicy +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy_rule import SubscriptionsPolicyRule +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy_rule_action import SubscriptionsPolicyRuleAction +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy_rule_field import SubscriptionsPolicyRuleField +from thousandeyes_sdk.cloud_insights_integrations.models.unauthorized_error import UnauthorizedError +from thousandeyes_sdk.cloud_insights_integrations.models.validation_error import ValidationError +from thousandeyes_sdk.cloud_insights_integrations.models.validation_error_item import ValidationErrorItem diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/__init__.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/__init__.py new file mode 100644 index 00000000..8f2bfb45 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/__init__.py @@ -0,0 +1,6 @@ +# flake8: noqa + +# import apis into api package +from thousandeyes_sdk.cloud_insights_integrations.api.cloud_insights_integration_policy_settings_api import CloudInsightsIntegrationPolicySettingsApi +from thousandeyes_sdk.cloud_insights_integrations.api.cloud_insights_integrations_api import CloudInsightsIntegrationsApi + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/cloud_insights_integration_policy_settings_api.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/cloud_insights_integration_policy_settings_api.py new file mode 100644 index 00000000..89a03fc6 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/cloud_insights_integration_policy_settings_api.py @@ -0,0 +1,1222 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.cloud_insights_integrations.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.cloud_insights_integrations.models.aws_integration_policy_setting import AwsIntegrationPolicySetting +from thousandeyes_sdk.cloud_insights_integrations.models.azure_integration_policy_setting import AzureIntegrationPolicySetting + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse + +from thousandeyes_sdk.core.rest import RESTResponseType + + +class CloudInsightsIntegrationPolicySettingsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-cloud-insights-integrations")) + self.api_client = api_client + + + @validate_call + def get_aws_integration_policy_settings( + 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, + ) -> AwsIntegrationPolicySetting: + """Get AWS integration policy settings + + Retrieves the AWS integration policy settings for the authenticated account group. Use this endpoint to audit which AWS resource group types and AWS regions are enabled, and whether CloudTrail is enabled, for Cloud Insights inventory monitoring. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_aws_integration_policy_settings_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': "AwsIntegrationPolicySetting", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def get_aws_integration_policy_settings_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[AwsIntegrationPolicySetting]: + """Get AWS integration policy settings + + Retrieves the AWS integration policy settings for the authenticated account group. Use this endpoint to audit which AWS resource group types and AWS regions are enabled, and whether CloudTrail is enabled, for Cloud Insights inventory monitoring. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_aws_integration_policy_settings_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': "AwsIntegrationPolicySetting", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def get_aws_integration_policy_settings_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 AWS integration policy settings + + Retrieves the AWS integration policy settings for the authenticated account group. Use this endpoint to audit which AWS resource group types and AWS regions are enabled, and whether CloudTrail is enabled, for Cloud Insights inventory monitoring. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_aws_integration_policy_settings_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': "AwsIntegrationPolicySetting", + '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_aws_integration_policy_settings_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/cloud-insights/integration/aws/policy/settings', + 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_azure_integration_policy_settings( + 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, + ) -> AzureIntegrationPolicySetting: + """Get Azure integration policy settings + + Retrieves the Azure integration policy settings for the authenticated account group. Use this endpoint to review which Azure resource group types are monitored and inspect the subscriptions policy rules that gate which subscriptions ThousandEyes inventories. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_azure_integration_policy_settings_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': "AzureIntegrationPolicySetting", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def get_azure_integration_policy_settings_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[AzureIntegrationPolicySetting]: + """Get Azure integration policy settings + + Retrieves the Azure integration policy settings for the authenticated account group. Use this endpoint to review which Azure resource group types are monitored and inspect the subscriptions policy rules that gate which subscriptions ThousandEyes inventories. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_azure_integration_policy_settings_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': "AzureIntegrationPolicySetting", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def get_azure_integration_policy_settings_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 Azure integration policy settings + + Retrieves the Azure integration policy settings for the authenticated account group. Use this endpoint to review which Azure resource group types are monitored and inspect the subscriptions policy rules that gate which subscriptions ThousandEyes inventories. + + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_azure_integration_policy_settings_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': "AzureIntegrationPolicySetting", + '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_azure_integration_policy_settings_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/cloud-insights/integration/azure/policy/settings', + 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_aws_integration_policy_settings( + self, + aws_integration_policy_setting: AwsIntegrationPolicySetting, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AwsIntegrationPolicySetting: + """Update AWS integration policy settings + + Updates the AWS integration policy settings for the authenticated account group. This endpoint lets you enable or disable specific AWS resource group types, adjust the set of AWS regions to inventory, and control whether CloudTrail is enabled for inventory monitoring. + + :param aws_integration_policy_setting: (required) + :type aws_integration_policy_setting: AwsIntegrationPolicySetting + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_integration_policy_settings_serialize( + aws_integration_policy_setting=aws_integration_policy_setting, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AwsIntegrationPolicySetting", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def update_aws_integration_policy_settings_with_http_info( + self, + aws_integration_policy_setting: AwsIntegrationPolicySetting, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AwsIntegrationPolicySetting]: + """Update AWS integration policy settings + + Updates the AWS integration policy settings for the authenticated account group. This endpoint lets you enable or disable specific AWS resource group types, adjust the set of AWS regions to inventory, and control whether CloudTrail is enabled for inventory monitoring. + + :param aws_integration_policy_setting: (required) + :type aws_integration_policy_setting: AwsIntegrationPolicySetting + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_integration_policy_settings_serialize( + aws_integration_policy_setting=aws_integration_policy_setting, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AwsIntegrationPolicySetting", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def update_aws_integration_policy_settings_without_preload_content( + self, + aws_integration_policy_setting: AwsIntegrationPolicySetting, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 AWS integration policy settings + + Updates the AWS integration policy settings for the authenticated account group. This endpoint lets you enable or disable specific AWS resource group types, adjust the set of AWS regions to inventory, and control whether CloudTrail is enabled for inventory monitoring. + + :param aws_integration_policy_setting: (required) + :type aws_integration_policy_setting: AwsIntegrationPolicySetting + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_integration_policy_settings_serialize( + aws_integration_policy_setting=aws_integration_policy_setting, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AwsIntegrationPolicySetting", + '400': "ValidationError", + '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_aws_integration_policy_settings_serialize( + self, + aws_integration_policy_setting, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # 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 aws_integration_policy_setting is not None: + _body_params = aws_integration_policy_setting + + + # 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='/cloud-insights/integration/aws/policy/settings', + 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_azure_integration_policy_settings( + self, + azure_integration_policy_setting: AzureIntegrationPolicySetting, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AzureIntegrationPolicySetting: + """Update Azure integration policy settings + + Updates the Azure integration policy settings for the authenticated account group. This endpoint lets you enable or disable Azure resource group types and manage the subscriptions policy (rules plus default action) that controls which Azure subscriptions are inventoried. + + :param azure_integration_policy_setting: (required) + :type azure_integration_policy_setting: AzureIntegrationPolicySetting + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_integration_policy_settings_serialize( + azure_integration_policy_setting=azure_integration_policy_setting, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AzureIntegrationPolicySetting", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def update_azure_integration_policy_settings_with_http_info( + self, + azure_integration_policy_setting: AzureIntegrationPolicySetting, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AzureIntegrationPolicySetting]: + """Update Azure integration policy settings + + Updates the Azure integration policy settings for the authenticated account group. This endpoint lets you enable or disable Azure resource group types and manage the subscriptions policy (rules plus default action) that controls which Azure subscriptions are inventoried. + + :param azure_integration_policy_setting: (required) + :type azure_integration_policy_setting: AzureIntegrationPolicySetting + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_integration_policy_settings_serialize( + azure_integration_policy_setting=azure_integration_policy_setting, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AzureIntegrationPolicySetting", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def update_azure_integration_policy_settings_without_preload_content( + self, + azure_integration_policy_setting: AzureIntegrationPolicySetting, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Azure integration policy settings + + Updates the Azure integration policy settings for the authenticated account group. This endpoint lets you enable or disable Azure resource group types and manage the subscriptions policy (rules plus default action) that controls which Azure subscriptions are inventoried. + + :param azure_integration_policy_setting: (required) + :type azure_integration_policy_setting: AzureIntegrationPolicySetting + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_integration_policy_settings_serialize( + azure_integration_policy_setting=azure_integration_policy_setting, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AzureIntegrationPolicySetting", + '400': "ValidationError", + '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_azure_integration_policy_settings_serialize( + self, + azure_integration_policy_setting, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # 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 azure_integration_policy_setting is not None: + _body_params = azure_integration_policy_setting + + + # 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='/cloud-insights/integration/azure/policy/settings', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/cloud_insights_integrations_api.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/cloud_insights_integrations_api.py new file mode 100644 index 00000000..f46c5184 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/api/cloud_insights_integrations_api.py @@ -0,0 +1,4228 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.cloud_insights_integrations.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.cloud_insights_integrations.models.aws_flow_logs_integration_request import AwsFlowLogsIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.aws_inventory_integration_request import AwsInventoryIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integration import AwsMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integrations import AwsMonitoringIntegrations +from thousandeyes_sdk.cloud_insights_integrations.models.azure_flow_logs_integration_request import AzureFlowLogsIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.azure_inventory_integration_request import AzureInventoryIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integration import AzureMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integrations import AzureMonitoringIntegrations + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse + +from thousandeyes_sdk.core.rest import RESTResponseType + + +class CloudInsightsIntegrationsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-cloud-insights-integrations")) + self.api_client = api_client + + + @validate_call + def create_aws_flow_logs_monitoring_integration( + self, + aws_flow_logs_integration_request: AwsFlowLogsIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AwsMonitoringIntegration: + """Create AWS flow logs monitoring integration + + Creates a new AWS flow logs monitoring integration. + + :param aws_flow_logs_integration_request: (required) + :type aws_flow_logs_integration_request: AwsFlowLogsIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_flow_logs_monitoring_integration_serialize( + aws_flow_logs_integration_request=aws_flow_logs_integration_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': "AwsMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def create_aws_flow_logs_monitoring_integration_with_http_info( + self, + aws_flow_logs_integration_request: AwsFlowLogsIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AwsMonitoringIntegration]: + """Create AWS flow logs monitoring integration + + Creates a new AWS flow logs monitoring integration. + + :param aws_flow_logs_integration_request: (required) + :type aws_flow_logs_integration_request: AwsFlowLogsIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_flow_logs_monitoring_integration_serialize( + aws_flow_logs_integration_request=aws_flow_logs_integration_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': "AwsMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def create_aws_flow_logs_monitoring_integration_without_preload_content( + self, + aws_flow_logs_integration_request: AwsFlowLogsIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 AWS flow logs monitoring integration + + Creates a new AWS flow logs monitoring integration. + + :param aws_flow_logs_integration_request: (required) + :type aws_flow_logs_integration_request: AwsFlowLogsIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_flow_logs_monitoring_integration_serialize( + aws_flow_logs_integration_request=aws_flow_logs_integration_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': "AwsMonitoringIntegration", + '400': "ValidationError", + '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_aws_flow_logs_monitoring_integration_serialize( + self, + aws_flow_logs_integration_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # 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 aws_flow_logs_integration_request is not None: + _body_params = aws_flow_logs_integration_request + + + # 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='/cloud-insights/integration/aws/flow-logs', + 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 create_aws_inventory_monitoring_integration( + self, + aws_inventory_integration_request: AwsInventoryIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AwsMonitoringIntegration: + """Create AWS inventory monitoring integration + + Creates a new AWS inventory monitoring integration. + + :param aws_inventory_integration_request: (required) + :type aws_inventory_integration_request: AwsInventoryIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_inventory_monitoring_integration_serialize( + aws_inventory_integration_request=aws_inventory_integration_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': "AwsMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def create_aws_inventory_monitoring_integration_with_http_info( + self, + aws_inventory_integration_request: AwsInventoryIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AwsMonitoringIntegration]: + """Create AWS inventory monitoring integration + + Creates a new AWS inventory monitoring integration. + + :param aws_inventory_integration_request: (required) + :type aws_inventory_integration_request: AwsInventoryIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_inventory_monitoring_integration_serialize( + aws_inventory_integration_request=aws_inventory_integration_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': "AwsMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def create_aws_inventory_monitoring_integration_without_preload_content( + self, + aws_inventory_integration_request: AwsInventoryIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 AWS inventory monitoring integration + + Creates a new AWS inventory monitoring integration. + + :param aws_inventory_integration_request: (required) + :type aws_inventory_integration_request: AwsInventoryIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_inventory_monitoring_integration_serialize( + aws_inventory_integration_request=aws_inventory_integration_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': "AwsMonitoringIntegration", + '400': "ValidationError", + '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_aws_inventory_monitoring_integration_serialize( + self, + aws_inventory_integration_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # 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 aws_inventory_integration_request is not None: + _body_params = aws_inventory_integration_request + + + # 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='/cloud-insights/integration/aws/inventory', + 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 create_azure_flow_logs_monitoring_integration( + self, + azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AzureMonitoringIntegration: + """Create Azure flow logs monitoring integration + + Creates a new Azure flow logs monitoring integration. + + :param azure_flow_logs_integration_request: (required) + :type azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_flow_logs_monitoring_integration_serialize( + azure_flow_logs_integration_request=azure_flow_logs_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def create_azure_flow_logs_monitoring_integration_with_http_info( + self, + azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AzureMonitoringIntegration]: + """Create Azure flow logs monitoring integration + + Creates a new Azure flow logs monitoring integration. + + :param azure_flow_logs_integration_request: (required) + :type azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_flow_logs_monitoring_integration_serialize( + azure_flow_logs_integration_request=azure_flow_logs_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def create_azure_flow_logs_monitoring_integration_without_preload_content( + self, + azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Azure flow logs monitoring integration + + Creates a new Azure flow logs monitoring integration. + + :param azure_flow_logs_integration_request: (required) + :type azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_flow_logs_monitoring_integration_serialize( + azure_flow_logs_integration_request=azure_flow_logs_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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_azure_flow_logs_monitoring_integration_serialize( + self, + azure_flow_logs_integration_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # 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 azure_flow_logs_integration_request is not None: + _body_params = azure_flow_logs_integration_request + + + # 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='/cloud-insights/integration/azure/flow-logs', + 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 create_azure_inventory_monitoring_integration( + self, + azure_inventory_integration_request: AzureInventoryIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AzureMonitoringIntegration: + """Create Azure inventory monitoring integration + + Creates a new Azure inventory monitoring integration. + + :param azure_inventory_integration_request: (required) + :type azure_inventory_integration_request: AzureInventoryIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_inventory_monitoring_integration_serialize( + azure_inventory_integration_request=azure_inventory_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def create_azure_inventory_monitoring_integration_with_http_info( + self, + azure_inventory_integration_request: AzureInventoryIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AzureMonitoringIntegration]: + """Create Azure inventory monitoring integration + + Creates a new Azure inventory monitoring integration. + + :param azure_inventory_integration_request: (required) + :type azure_inventory_integration_request: AzureInventoryIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_inventory_monitoring_integration_serialize( + azure_inventory_integration_request=azure_inventory_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def create_azure_inventory_monitoring_integration_without_preload_content( + self, + azure_inventory_integration_request: AzureInventoryIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Azure inventory monitoring integration + + Creates a new Azure inventory monitoring integration. + + :param azure_inventory_integration_request: (required) + :type azure_inventory_integration_request: AzureInventoryIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_inventory_monitoring_integration_serialize( + azure_inventory_integration_request=azure_inventory_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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_azure_inventory_monitoring_integration_serialize( + self, + azure_inventory_integration_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # 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 azure_inventory_integration_request is not None: + _body_params = azure_inventory_integration_request + + + # 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='/cloud-insights/integration/azure/inventory', + 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_aws_monitoring_integration( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 AWS integration + + Deletes a specific AWS inventory or flow logs monitoring integration using the AWS integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_monitoring_integration_serialize( + integration_id=integration_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def delete_aws_monitoring_integration_with_http_info( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 AWS integration + + Deletes a specific AWS inventory or flow logs monitoring integration using the AWS integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_monitoring_integration_serialize( + integration_id=integration_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def delete_aws_monitoring_integration_without_preload_content( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 AWS integration + + Deletes a specific AWS inventory or flow logs monitoring integration using the AWS integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_aws_monitoring_integration_serialize( + integration_id=integration_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '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 _delete_aws_monitoring_integration_serialize( + self, + integration_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if integration_id is not None: + _path_params['integrationId'] = integration_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='/cloud-insights/integration/aws/{integrationId}', + 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_azure_monitoring_integration( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Azure integration + + Deletes a specific Azure inventory or flow logs monitoring integration using the Azure integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_monitoring_integration_serialize( + integration_id=integration_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def delete_azure_monitoring_integration_with_http_info( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Azure integration + + Deletes a specific Azure inventory or flow logs monitoring integration using the Azure integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_monitoring_integration_serialize( + integration_id=integration_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def delete_azure_monitoring_integration_without_preload_content( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Azure integration + + Deletes a specific Azure inventory or flow logs monitoring integration using the Azure integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_monitoring_integration_serialize( + integration_id=integration_id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '400': "ValidationError", + '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 _delete_azure_monitoring_integration_serialize( + self, + integration_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if integration_id is not None: + _path_params['integrationId'] = integration_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='/cloud-insights/integration/azure/{integrationId}', + 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_all_aws_monitoring_integrations( + 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, + ) -> AwsMonitoringIntegrations: + """List AWS integrations + + Retrieves all AWS inventory and flow logs monitoring integrations configured for the authenticated account group 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_all_aws_monitoring_integrations_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': "AwsMonitoringIntegrations", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def get_all_aws_monitoring_integrations_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[AwsMonitoringIntegrations]: + """List AWS integrations + + Retrieves all AWS inventory and flow logs monitoring integrations configured for the authenticated account group 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_all_aws_monitoring_integrations_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': "AwsMonitoringIntegrations", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def get_all_aws_monitoring_integrations_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 AWS integrations + + Retrieves all AWS inventory and flow logs monitoring integrations configured for the authenticated account group 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_all_aws_monitoring_integrations_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': "AwsMonitoringIntegrations", + '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_all_aws_monitoring_integrations_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/cloud-insights/integration/aws', + 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_all_azure_monitoring_integrations( + 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, + ) -> AzureMonitoringIntegrations: + """List Azure integrations + + Retrieves all Azure inventory and flow logs monitoring integrations configured for the authenticated account group 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_all_azure_monitoring_integrations_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': "AzureMonitoringIntegrations", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def get_all_azure_monitoring_integrations_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[AzureMonitoringIntegrations]: + """List Azure integrations + + Retrieves all Azure inventory and flow logs monitoring integrations configured for the authenticated account group 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_all_azure_monitoring_integrations_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': "AzureMonitoringIntegrations", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def get_all_azure_monitoring_integrations_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 Azure integrations + + Retrieves all Azure inventory and flow logs monitoring integrations configured for the authenticated account group 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_all_azure_monitoring_integrations_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': "AzureMonitoringIntegrations", + '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_all_azure_monitoring_integrations_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/cloud-insights/integration/azure', + 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_aws_flowlogs_monitoring_integration_policies( + 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, + ) -> str: + """Get AWS flow logs monitoring IAM policies + + Retrieves the AWS IAM policies required to configure an AWS flow logs monitoring integration in JSON string format for the authenticated 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_aws_flowlogs_monitoring_integration_policies_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': "str", + '401': "UnauthorizedError", + '403': "Error", + '404': "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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def get_aws_flowlogs_monitoring_integration_policies_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[str]: + """Get AWS flow logs monitoring IAM policies + + Retrieves the AWS IAM policies required to configure an AWS flow logs monitoring integration in JSON string format for the authenticated 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_aws_flowlogs_monitoring_integration_policies_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': "str", + '401': "UnauthorizedError", + '403': "Error", + '404': "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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def get_aws_flowlogs_monitoring_integration_policies_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 AWS flow logs monitoring IAM policies + + Retrieves the AWS IAM policies required to configure an AWS flow logs monitoring integration in JSON string format for the authenticated 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_aws_flowlogs_monitoring_integration_policies_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': "str", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_aws_flowlogs_monitoring_integration_policies_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # 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='GET', + resource_path='/cloud-insights/integration/aws/flow-logs/policies', + 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_aws_inventory_monitoring_integration_policies( + 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, + ) -> str: + """Get AWS inventory monitoring IAM policies + + Retrieves the AWS IAM policies required to configure an AWS inventory monitoring integration in JSON string format for the authenticated 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_aws_inventory_monitoring_integration_policies_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': "str", + '401': "UnauthorizedError", + '403': "Error", + '404': "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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def get_aws_inventory_monitoring_integration_policies_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[str]: + """Get AWS inventory monitoring IAM policies + + Retrieves the AWS IAM policies required to configure an AWS inventory monitoring integration in JSON string format for the authenticated 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_aws_inventory_monitoring_integration_policies_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': "str", + '401': "UnauthorizedError", + '403': "Error", + '404': "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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def get_aws_inventory_monitoring_integration_policies_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 AWS inventory monitoring IAM policies + + Retrieves the AWS IAM policies required to configure an AWS inventory monitoring integration in JSON string format for the authenticated 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_aws_inventory_monitoring_integration_policies_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': "str", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_aws_inventory_monitoring_integration_policies_serialize( + self, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # 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='GET', + resource_path='/cloud-insights/integration/aws/inventory/policies', + 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_aws_monitoring_integration( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AwsMonitoringIntegration: + """Get AWS integration + + Retrieves details for a specific AWS inventory or flow logs monitoring integration associated with the authenticated account group using the unique integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_aws_monitoring_integration_serialize( + integration_id=integration_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': "AwsMonitoringIntegration", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def get_aws_monitoring_integration_with_http_info( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AwsMonitoringIntegration]: + """Get AWS integration + + Retrieves details for a specific AWS inventory or flow logs monitoring integration associated with the authenticated account group using the unique integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_aws_monitoring_integration_serialize( + integration_id=integration_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': "AwsMonitoringIntegration", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def get_aws_monitoring_integration_without_preload_content( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 AWS integration + + Retrieves details for a specific AWS inventory or flow logs monitoring integration associated with the authenticated account group using the unique integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_aws_monitoring_integration_serialize( + integration_id=integration_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': "AwsMonitoringIntegration", + '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_aws_monitoring_integration_serialize( + self, + integration_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if integration_id is not None: + _path_params['integrationId'] = integration_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/cloud-insights/integration/aws/{integrationId}', + 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_azure_monitoring_integration( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AzureMonitoringIntegration: + """Get Azure integration + + Retrieves details for a specific Azure inventory or flow logs monitoring integration associated with the authenticated account group using the unique integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_azure_monitoring_integration_serialize( + integration_id=integration_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': "AzureMonitoringIntegration", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def get_azure_monitoring_integration_with_http_info( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AzureMonitoringIntegration]: + """Get Azure integration + + Retrieves details for a specific Azure inventory or flow logs monitoring integration associated with the authenticated account group using the unique integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_azure_monitoring_integration_serialize( + integration_id=integration_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': "AzureMonitoringIntegration", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def get_azure_monitoring_integration_without_preload_content( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Azure integration + + Retrieves details for a specific Azure inventory or flow logs monitoring integration associated with the authenticated account group using the unique integration ID. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_azure_monitoring_integration_serialize( + integration_id=integration_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': "AzureMonitoringIntegration", + '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_azure_monitoring_integration_serialize( + self, + integration_id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if integration_id is not None: + _path_params['integrationId'] = integration_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/cloud-insights/integration/azure/{integrationId}', + 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_azure_flow_logs_monitoring_integration( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AzureMonitoringIntegration: + """Update Azure flow logs monitoring integration + + Updates an existing Azure flow logs monitoring integration. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param azure_flow_logs_integration_request: (required) + :type azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_flow_logs_monitoring_integration_serialize( + integration_id=integration_id, + azure_flow_logs_integration_request=azure_flow_logs_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def update_azure_flow_logs_monitoring_integration_with_http_info( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AzureMonitoringIntegration]: + """Update Azure flow logs monitoring integration + + Updates an existing Azure flow logs monitoring integration. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param azure_flow_logs_integration_request: (required) + :type azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_flow_logs_monitoring_integration_serialize( + integration_id=integration_id, + azure_flow_logs_integration_request=azure_flow_logs_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def update_azure_flow_logs_monitoring_integration_without_preload_content( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Azure flow logs monitoring integration + + Updates an existing Azure flow logs monitoring integration. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param azure_flow_logs_integration_request: (required) + :type azure_flow_logs_integration_request: AzureFlowLogsIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_flow_logs_monitoring_integration_serialize( + integration_id=integration_id, + azure_flow_logs_integration_request=azure_flow_logs_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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_azure_flow_logs_monitoring_integration_serialize( + self, + integration_id, + azure_flow_logs_integration_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if integration_id is not None: + _path_params['integrationId'] = integration_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 azure_flow_logs_integration_request is not None: + _body_params = azure_flow_logs_integration_request + + + # 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='/cloud-insights/integration/azure/flow-logs/{integrationId}', + 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_azure_inventory_monitoring_integration( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + azure_inventory_integration_request: AzureInventoryIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AzureMonitoringIntegration: + """Update Azure inventory monitoring integration + + Updates an existing Azure inventory monitoring integration. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param azure_inventory_integration_request: (required) + :type azure_inventory_integration_request: AzureInventoryIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_inventory_monitoring_integration_serialize( + integration_id=integration_id, + azure_inventory_integration_request=azure_inventory_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ).data + + + @validate_call + def update_azure_inventory_monitoring_integration_with_http_info( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + azure_inventory_integration_request: AzureInventoryIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AzureMonitoringIntegration]: + """Update Azure inventory monitoring integration + + Updates an existing Azure inventory monitoring integration. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param azure_inventory_integration_request: (required) + :type azure_inventory_integration_request: AzureInventoryIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_inventory_monitoring_integration_serialize( + integration_id=integration_id, + azure_inventory_integration_request=azure_inventory_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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, + models=thousandeyes_sdk.cloud_insights_integrations.models, + ) + + + @validate_call + def update_azure_inventory_monitoring_integration_without_preload_content( + self, + integration_id: Annotated[StrictStr, Field(description="The unique ID of the AWS or Azure inventory or flow logs monitoring integration.")], + azure_inventory_integration_request: AzureInventoryIntegrationRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Azure inventory monitoring integration + + Updates an existing Azure inventory monitoring integration. + + :param integration_id: The unique ID of the AWS or Azure inventory or flow logs monitoring integration. (required) + :type integration_id: str + :param azure_inventory_integration_request: (required) + :type azure_inventory_integration_request: AzureInventoryIntegrationRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_azure_inventory_monitoring_integration_serialize( + integration_id=integration_id, + azure_inventory_integration_request=azure_inventory_integration_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': "AzureMonitoringIntegration", + '400': "ValidationError", + '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_azure_inventory_monitoring_integration_serialize( + self, + integration_id, + azure_inventory_integration_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if integration_id is not None: + _path_params['integrationId'] = integration_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 azure_inventory_integration_request is not None: + _body_params = azure_inventory_integration_request + + + # 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='/cloud-insights/integration/azure/inventory/{integrationId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/__init__.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/__init__.py new file mode 100644 index 00000000..091a5c5f --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/__init__.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +# flake8: noqa +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from thousandeyes_sdk.cloud_insights_integrations.models.aws_flow_logs_integration_request import AwsFlowLogsIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.aws_integration_policy_setting import AwsIntegrationPolicySetting +from thousandeyes_sdk.cloud_insights_integrations.models.aws_inventory_integration_request import AwsInventoryIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integration import AwsMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integrations import AwsMonitoringIntegrations +from thousandeyes_sdk.cloud_insights_integrations.models.aws_region import AwsRegion +from thousandeyes_sdk.cloud_insights_integrations.models.aws_resource_group_type import AwsResourceGroupType +from thousandeyes_sdk.cloud_insights_integrations.models.azure_flow_logs_integration_request import AzureFlowLogsIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.azure_integration_policy_setting import AzureIntegrationPolicySetting +from thousandeyes_sdk.cloud_insights_integrations.models.azure_inventory_integration_request import AzureInventoryIntegrationRequest +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integration import AzureMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integrations import AzureMonitoringIntegrations +from thousandeyes_sdk.cloud_insights_integrations.models.azure_resource_group_type import AzureResourceGroupType +from thousandeyes_sdk.cloud_insights_integrations.models.error import Error +from thousandeyes_sdk.cloud_insights_integrations.models.link import Link +from thousandeyes_sdk.cloud_insights_integrations.models.self_links import SelfLinks +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy import SubscriptionsPolicy +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy_rule import SubscriptionsPolicyRule +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy_rule_action import SubscriptionsPolicyRuleAction +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy_rule_field import SubscriptionsPolicyRuleField +from thousandeyes_sdk.cloud_insights_integrations.models.unauthorized_error import UnauthorizedError +from thousandeyes_sdk.cloud_insights_integrations.models.validation_error import ValidationError +from thousandeyes_sdk.cloud_insights_integrations.models.validation_error_item import ValidationErrorItem diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_flow_logs_integration_request.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_flow_logs_integration_request.py new file mode 100644 index 00000000..4459db8e --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_flow_logs_integration_request.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AwsFlowLogsIntegrationRequest(BaseModel): + """ + AwsFlowLogsIntegrationRequest + """ # noqa: E501 + name: StrictStr = Field(description="The name of the AWS flow logs monitoring integration.") + role_arn: StrictStr = Field(description="The ARN of the AWS role to be monitored.", alias="roleArn") + sns_topics_arns: List[StrictStr] = Field(description="The array of SNS topics ARNs.", alias="snsTopicsArns") + __properties: ClassVar[List[str]] = ["name", "roleArn", "snsTopicsArns"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AwsFlowLogsIntegrationRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AwsFlowLogsIntegrationRequest 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"), + "roleArn": obj.get("roleArn"), + "snsTopicsArns": obj.get("snsTopicsArns") + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_integration_policy_setting.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_integration_policy_setting.py new file mode 100644 index 00000000..a3c22251 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_integration_policy_setting.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.cloud_insights_integrations.models.aws_region import AwsRegion +from thousandeyes_sdk.cloud_insights_integrations.models.aws_resource_group_type import AwsResourceGroupType +from thousandeyes_sdk.cloud_insights_integrations.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class AwsIntegrationPolicySetting(BaseModel): + """ + AWS integration policy configuration that controls which resource groups and regions ThousandEyes inventories, and whether CloudTrail is enabled. + """ # noqa: E501 + enabled_resource_group_types: List[AwsResourceGroupType] = Field(description="The set of AWS resource group types included in inventory monitoring.", alias="enabledResourceGroupTypes") + enabled_regions: List[AwsRegion] = Field(description="The AWS regions that ThousandEyes inventories for the account group.", alias="enabledRegions") + enabled_cloudtrail: StrictBool = Field(description="Indicates whether CloudTrail integration is enabled for AWS inventory monitoring.", alias="enabledCloudtrail") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["enabledResourceGroupTypes", "enabledRegions", "enabledCloudtrail", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AwsIntegrationPolicySetting from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AwsIntegrationPolicySetting from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "enabledResourceGroupTypes": obj.get("enabledResourceGroupTypes"), + "enabledRegions": obj.get("enabledRegions"), + "enabledCloudtrail": obj.get("enabledCloudtrail"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_inventory_integration_request.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_inventory_integration_request.py new file mode 100644 index 00000000..488eef15 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_inventory_integration_request.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AwsInventoryIntegrationRequest(BaseModel): + """ + AwsInventoryIntegrationRequest + """ # noqa: E501 + name: StrictStr = Field(description="The name of the AWS inventory monitoring integration.") + role_arn: StrictStr = Field(description="The ARN of the AWS role to be monitored.", alias="roleArn") + __properties: ClassVar[List[str]] = ["name", "roleArn"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AwsInventoryIntegrationRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AwsInventoryIntegrationRequest 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"), + "roleArn": obj.get("roleArn") + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_monitoring_integration.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_monitoring_integration.py new file mode 100644 index 00000000..ad6c9d25 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_monitoring_integration.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.cloud_insights_integrations.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class AwsMonitoringIntegration(BaseModel): + """ + AwsMonitoringIntegration + """ # noqa: E501 + id: StrictStr = Field(description="The unique ID for the AWS inventory or flow logs monitoring integration.") + name: StrictStr = Field(description="The name of the AWS inventory or flow logs monitoring integration.") + role_arn: StrictStr = Field(description="The ARN of the AWS role to be monitored.", alias="roleArn") + external_id: StrictStr = Field(description="The external ID associated with the account group.", alias="externalId") + monitoring_type: StrictStr = Field(description="The type of monitoring integration.", alias="monitoringType") + sns_topics_arns: Optional[List[StrictStr]] = Field(default=None, description="The array of SNS topic ARNs. Relevant only for flow logs monitoring integrations.", alias="snsTopicsArns") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "name", "roleArn", "externalId", "monitoringType", "snsTopicsArns", "_links"] + + @field_validator('monitoring_type') + def monitoring_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['inventory-monitoring', 'flow-logs-monitoring', 'unknown']): + raise ValueError("must be one of enum values ('inventory-monitoring', 'flow-logs-monitoring', 'unknown')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AwsMonitoringIntegration from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AwsMonitoringIntegration 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"), + "roleArn": obj.get("roleArn"), + "externalId": obj.get("externalId"), + "monitoringType": obj.get("monitoringType"), + "snsTopicsArns": obj.get("snsTopicsArns"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_monitoring_integrations.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_monitoring_integrations.py new file mode 100644 index 00000000..69456c3b --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_monitoring_integrations.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.cloud_insights_integrations.models.aws_monitoring_integration import AwsMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class AwsMonitoringIntegrations(BaseModel): + """ + A HAL resource containing a list of AWS monitoring integrations and navigation links. + """ # noqa: E501 + integrations: List[AwsMonitoringIntegration] = Field(description="The list of AWS inventory and flow logs monitoring integrations.") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["integrations", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AwsMonitoringIntegrations from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in integrations (list) + _items = [] + if self.integrations: + for _item in self.integrations: + if _item: + _items.append(_item.to_dict()) + _dict['integrations'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AwsMonitoringIntegrations from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "integrations": [AwsMonitoringIntegration.from_dict(_item) for _item in obj["integrations"]] if obj.get("integrations") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_region.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_region.py new file mode 100644 index 00000000..7fac18be --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_region.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class AwsRegion(str, Enum): + """ + AWS region identifier that can be enabled for Cloud Insights inventory monitoring. + """ + + """ + allowed enum values + """ + US_MINUS_EAST_MINUS_1 = 'us-east-1' + US_MINUS_EAST_MINUS_2 = 'us-east-2' + US_MINUS_WEST_MINUS_1 = 'us-west-1' + US_MINUS_WEST_MINUS_2 = 'us-west-2' + CA_MINUS_CENTRAL_MINUS_1 = 'ca-central-1' + CA_MINUS_WEST_MINUS_1 = 'ca-west-1' + MX_MINUS_CENTRAL_MINUS_1 = 'mx-central-1' + SA_MINUS_EAST_MINUS_1 = 'sa-east-1' + EU_MINUS_CENTRAL_MINUS_1 = 'eu-central-1' + EU_MINUS_WEST_MINUS_1 = 'eu-west-1' + EU_MINUS_WEST_MINUS_2 = 'eu-west-2' + EU_MINUS_SOUTH_MINUS_1 = 'eu-south-1' + EU_MINUS_WEST_MINUS_3 = 'eu-west-3' + EU_MINUS_SOUTH_MINUS_2 = 'eu-south-2' + EU_MINUS_NORTH_MINUS_1 = 'eu-north-1' + EU_MINUS_CENTRAL_MINUS_2 = 'eu-central-2' + IL_MINUS_CENTRAL_MINUS_1 = 'il-central-1' + ME_MINUS_SOUTH_MINUS_1 = 'me-south-1' + ME_MINUS_CENTRAL_MINUS_1 = 'me-central-1' + AF_MINUS_SOUTH_MINUS_1 = 'af-south-1' + AP_MINUS_EAST_MINUS_1 = 'ap-east-1' + AP_MINUS_SOUTH_MINUS_2 = 'ap-south-2' + AP_MINUS_SOUTHEAST_MINUS_3 = 'ap-southeast-3' + AP_MINUS_SOUTHEAST_MINUS_5 = 'ap-southeast-5' + AP_MINUS_SOUTHEAST_MINUS_4 = 'ap-southeast-4' + AP_MINUS_SOUTHEAST_MINUS_7 = 'ap-southeast-7' + AP_MINUS_SOUTH_MINUS_1 = 'ap-south-1' + AP_MINUS_NORTHEAST_MINUS_3 = 'ap-northeast-3' + AP_MINUS_NORTHEAST_MINUS_2 = 'ap-northeast-2' + AP_MINUS_SOUTHEAST_MINUS_1 = 'ap-southeast-1' + AP_MINUS_SOUTHEAST_MINUS_2 = 'ap-southeast-2' + AP_MINUS_NORTHEAST_MINUS_1 = 'ap-northeast-1' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AwsRegion from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_resource_group_type.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_resource_group_type.py new file mode 100644 index 00000000..85f46804 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/aws_resource_group_type.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class AwsResourceGroupType(str, Enum): + """ + Supported AWS resource group types that can be toggled within policy settings. Note that ec2 is a mandatory resource group type and will be enabled regardless of user configuration. + """ + + """ + allowed enum values + """ + CLOUDFRONT = 'cloudfront' + EC2 = 'ec2' + EKS_MINUS_ECS = 'eks-ecs' + GLOBAL_MINUS_ACCELERATOR = 'global-accelerator' + DIRECT_MINUS_CONNECT = 'direct-connect' + S3_MINUS_BUCKET = 's3-bucket' + NETWORK_MINUS_FIREWALL = 'network-firewall' + GLOBAL_MINUS_NETWORK = 'global-network' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AwsResourceGroupType from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_flow_logs_integration_request.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_flow_logs_integration_request.py new file mode 100644 index 00000000..c8f301bc --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_flow_logs_integration_request.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AzureFlowLogsIntegrationRequest(BaseModel): + """ + AzureFlowLogsIntegrationRequest + """ # noqa: E501 + name: StrictStr = Field(description="The name of the Azure flow logs monitoring integration.") + app_id: StrictStr = Field(description="The Application (client) ID of the service principal.", alias="appId") + password: StrictStr = Field(description="The client secret value.") + azure_tenant_id: StrictStr = Field(description="The Azure Active Directory tenant ID.", alias="azureTenantId") + service_bus_queue_url: StrictStr = Field(description="The URL of the Service Bus Queue.", alias="serviceBusQueueUrl") + __properties: ClassVar[List[str]] = ["name", "appId", "password", "azureTenantId", "serviceBusQueueUrl"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AzureFlowLogsIntegrationRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AzureFlowLogsIntegrationRequest 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"), + "appId": obj.get("appId"), + "password": obj.get("password"), + "azureTenantId": obj.get("azureTenantId"), + "serviceBusQueueUrl": obj.get("serviceBusQueueUrl") + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_integration_policy_setting.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_integration_policy_setting.py new file mode 100644 index 00000000..f1fd7842 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_integration_policy_setting.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.cloud_insights_integrations.models.azure_resource_group_type import AzureResourceGroupType +from thousandeyes_sdk.cloud_insights_integrations.models.self_links import SelfLinks +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy import SubscriptionsPolicy +from typing import Optional, Set +from typing_extensions import Self + +class AzureIntegrationPolicySetting(BaseModel): + """ + Azure integration policy configuration that defines the monitored Azure resource groups and the subscription policy that ThousandEyes enforces. + """ # noqa: E501 + enabled_resource_group_types: List[AzureResourceGroupType] = Field(description="The set of Azure resource group types included in inventory monitoring.", alias="enabledResourceGroupTypes") + subscriptions_policy: SubscriptionsPolicy = Field(alias="subscriptionsPolicy") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["enabledResourceGroupTypes", "subscriptionsPolicy", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AzureIntegrationPolicySetting from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of subscriptions_policy + if self.subscriptions_policy: + _dict['subscriptionsPolicy'] = self.subscriptions_policy.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AzureIntegrationPolicySetting from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "enabledResourceGroupTypes": obj.get("enabledResourceGroupTypes"), + "subscriptionsPolicy": SubscriptionsPolicy.from_dict(obj["subscriptionsPolicy"]) if obj.get("subscriptionsPolicy") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_inventory_integration_request.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_inventory_integration_request.py new file mode 100644 index 00000000..bca5cf83 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_inventory_integration_request.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class AzureInventoryIntegrationRequest(BaseModel): + """ + AzureInventoryIntegrationRequest + """ # noqa: E501 + name: StrictStr = Field(description="The name of the Azure inventory monitoring integration.") + app_id: StrictStr = Field(description="The Application (client) ID of the service principal.", alias="appId") + password: StrictStr = Field(description="The client secret value.") + azure_tenant_id: StrictStr = Field(description="The Azure Active Directory tenant ID.", alias="azureTenantId") + __properties: ClassVar[List[str]] = ["name", "appId", "password", "azureTenantId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AzureInventoryIntegrationRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AzureInventoryIntegrationRequest 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"), + "appId": obj.get("appId"), + "password": obj.get("password"), + "azureTenantId": obj.get("azureTenantId") + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_monitoring_integration.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_monitoring_integration.py new file mode 100644 index 00000000..8088d7ee --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_monitoring_integration.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.cloud_insights_integrations.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class AzureMonitoringIntegration(BaseModel): + """ + AzureMonitoringIntegration + """ # noqa: E501 + id: StrictStr = Field(description="The unique ID for the Azure inventory or flow logs monitoring integration.") + name: StrictStr = Field(description="The name of the Azure inventory or flow logs monitoring integration.") + app_id: StrictStr = Field(description="The Application (client) ID of the service principal.", alias="appId") + password: StrictStr = Field(description="The client secret value. For security reasons, the client secret value is masked.") + azure_tenant_id: StrictStr = Field(description="The Azure Active Directory tenant ID.", alias="azureTenantId") + service_bus_queue_url: Optional[StrictStr] = Field(default=None, description="The URL of the Service Bus Queue. Relevant only for flow logs monitoring integrations.", alias="serviceBusQueueUrl") + monitoring_type: StrictStr = Field(description="The type of monitoring integration.", alias="monitoringType") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "name", "appId", "password", "azureTenantId", "serviceBusQueueUrl", "monitoringType", "_links"] + + @field_validator('monitoring_type') + def monitoring_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['azure-inventory-monitoring', 'azure-flow-logs-monitoring', 'unknown']): + raise ValueError("must be one of enum values ('azure-inventory-monitoring', 'azure-flow-logs-monitoring', 'unknown')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AzureMonitoringIntegration from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AzureMonitoringIntegration 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"), + "appId": obj.get("appId"), + "password": obj.get("password"), + "azureTenantId": obj.get("azureTenantId"), + "serviceBusQueueUrl": obj.get("serviceBusQueueUrl"), + "monitoringType": obj.get("monitoringType"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_monitoring_integrations.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_monitoring_integrations.py new file mode 100644 index 00000000..9def06cc --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_monitoring_integrations.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.cloud_insights_integrations.models.azure_monitoring_integration import AzureMonitoringIntegration +from thousandeyes_sdk.cloud_insights_integrations.models.self_links import SelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class AzureMonitoringIntegrations(BaseModel): + """ + A HAL resource containing a list of Azure inventory and flow logs monitoring integrations. + """ # noqa: E501 + integrations: List[AzureMonitoringIntegration] = Field(description="The list of Azure inventory and flow logs monitoring integrations.") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["integrations", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AzureMonitoringIntegrations from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in integrations (list) + _items = [] + if self.integrations: + for _item in self.integrations: + if _item: + _items.append(_item.to_dict()) + _dict['integrations'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AzureMonitoringIntegrations from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "integrations": [AzureMonitoringIntegration.from_dict(_item) for _item in obj["integrations"]] if obj.get("integrations") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_resource_group_type.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_resource_group_type.py new file mode 100644 index 00000000..d8230977 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/azure_resource_group_type.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class AzureResourceGroupType(str, Enum): + """ + Supported Azure resource group types that can be toggled within policy settings. Note that networking is a mandatory resource group type and will be enabled regardless of user configuration. + """ + + """ + allowed enum values + """ + AFD = 'afd' + SECURITY = 'security' + EXPRESS_MINUS_ROUTE = 'express-route' + VIRTUAL_MINUS_WAN = 'virtual-wan' + TRAFFIC_MINUS_MANAGER = 'traffic-manager' + NETWORKING = 'networking' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AzureResourceGroupType from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/error.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/error.py new file mode 100644 index 00000000..1a86c1c5 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/error.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Error(BaseModel): + """ + Error + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\".") + title: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the problem type.") + status: Optional[StrictInt] = Field(default=None, description="The HTTP status code generated by the origin server for this occurrence of the problem.") + detail: Optional[StrictStr] = Field(default=None, description="A human-readable explanation specific to this occurrence of the problem.") + instance: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the specific occurrence of the problem.") + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Error from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Error from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "status": obj.get("status"), + "detail": obj.get("detail"), + "instance": obj.get("instance") + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/link.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/link.py new file mode 100644 index 00000000..5d04a1bd --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/link.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Link(BaseModel): + """ + A hyperlink from the containing resource to a URI. + """ # noqa: E501 + href: StrictStr = Field(description="Its value is either a URI [RFC3986] or a URI template [RFC6570].") + templated: Optional[StrictBool] = Field(default=None, description="Should be true when the link object's \"href\" property is a URI template.") + type: Optional[StrictStr] = Field(default=None, description="Used as a hint to indicate the media type expected when dereferencing the target resource.") + deprecation: Optional[StrictStr] = Field(default=None, description="Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation.") + name: Optional[StrictStr] = Field(default=None, description="Its value may be used as a secondary key for selecting link objects that share the same relation type.") + profile: Optional[StrictStr] = Field(default=None, description="A URI that hints about the profile of the target resource.") + title: Optional[StrictStr] = Field(default=None, description="Intended for labelling the link with a human-readable identifier") + hreflang: Optional[StrictStr] = Field(default=None, description="Indicates the language of the target resource") + __properties: ClassVar[List[str]] = ["href", "templated", "type", "deprecation", "name", "profile", "title", "hreflang"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Link from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Link from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "href": obj.get("href"), + "templated": obj.get("templated"), + "type": obj.get("type"), + "deprecation": obj.get("deprecation"), + "name": obj.get("name"), + "profile": obj.get("profile"), + "title": obj.get("title"), + "hreflang": obj.get("hreflang") + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/self_links.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/self_links.py new file mode 100644 index 00000000..0a7c4f12 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/self_links.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.cloud_insights_integrations.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class SelfLinks(BaseModel): + """ + A links object containing the self link. + """ # noqa: E501 + var_self: Optional[Link] = Field(default=None, alias="self") + __properties: ClassVar[List[str]] = ["self"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SelfLinks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of var_self + if self.var_self: + _dict['self'] = self.var_self.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SelfLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": Link.from_dict(obj["self"]) if obj.get("self") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy.py new file mode 100644 index 00000000..688c5552 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy_rule import SubscriptionsPolicyRule +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy_rule_action import SubscriptionsPolicyRuleAction +from typing import Optional, Set +from typing_extensions import Self + +class SubscriptionsPolicy(BaseModel): + """ + Policy document that controls which Azure subscriptions are inventoried. Up to 10 rules can be provided. Rules are evaluated in order; if none match, the defaultAction is applied. + """ # noqa: E501 + rules: Annotated[List[SubscriptionsPolicyRule], Field(max_length=10)] = Field(description="Ordered list of subscription policy rules. Maximum of 10 entries.") + default_action: SubscriptionsPolicyRuleAction = Field(alias="defaultAction") + __properties: ClassVar[List[str]] = ["rules", "defaultAction"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubscriptionsPolicy from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rules (list) + _items = [] + if self.rules: + for _item in self.rules: + if _item: + _items.append(_item.to_dict()) + _dict['rules'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubscriptionsPolicy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "rules": [SubscriptionsPolicyRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None, + "defaultAction": obj.get("defaultAction") + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule.py new file mode 100644 index 00000000..c7afd14e --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy_rule_action import SubscriptionsPolicyRuleAction +from thousandeyes_sdk.cloud_insights_integrations.models.subscriptions_policy_rule_field import SubscriptionsPolicyRuleField +from typing import Optional, Set +from typing_extensions import Self + +class SubscriptionsPolicyRule(BaseModel): + """ + A single subscription rule consisting of a field, pattern, and action. + """ # noqa: E501 + var_field: SubscriptionsPolicyRuleField = Field(alias="field") + pattern: StrictStr = Field(description="String or regular expression used to match subscription identifiers or names.") + action: SubscriptionsPolicyRuleAction + __properties: ClassVar[List[str]] = ["field", "pattern", "action"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubscriptionsPolicyRule from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubscriptionsPolicyRule from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "field": obj.get("field"), + "pattern": obj.get("pattern"), + "action": obj.get("action") + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule_action.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule_action.py new file mode 100644 index 00000000..e36d3751 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule_action.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SubscriptionsPolicyRuleAction(str, Enum): + """ + Action applied when a subscriptions policy rule matches. + """ + + """ + allowed enum values + """ + INCLUDE = 'include' + EXCLUDE = 'exclude' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SubscriptionsPolicyRuleAction from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule_field.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule_field.py new file mode 100644 index 00000000..92b209de --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/subscriptions_policy_rule_field.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SubscriptionsPolicyRuleField(str, Enum): + """ + Identifies whether the rule evaluates subscription IDs or subscription names. + """ + + """ + allowed enum values + """ + SUBSCRIPTION_MINUS_ID = 'subscription-id' + SUBSCRIPTION_MINUS_NAME = 'subscription-name' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SubscriptionsPolicyRuleField from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/unauthorized_error.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/unauthorized_error.py new file mode 100644 index 00000000..8d5f0817 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UnauthorizedError(BaseModel): + """ + UnauthorizedError + """ # noqa: E501 + error: Optional[StrictStr] = None + error_description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["error", "error_description"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnauthorizedError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnauthorizedError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "error_description": obj.get("error_description") + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/validation_error.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/validation_error.py new file mode 100644 index 00000000..51a62911 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/validation_error.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.cloud_insights_integrations.models.validation_error_item import ValidationErrorItem +from typing import Optional, Set +from typing_extensions import Self + +class ValidationError(BaseModel): + """ + ValidationError + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\".") + title: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the problem type.") + status: Optional[StrictInt] = Field(default=None, description="The HTTP status code generated by the origin server for this occurrence of the problem.") + detail: Optional[StrictStr] = Field(default=None, description="A human-readable explanation specific to this occurrence of the problem.") + instance: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the specific occurrence of the problem.") + errors: Optional[List[ValidationErrorItem]] = Field(default=None, description="(Optional) When multiple errors occur, the details for each error are listed.") + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance", "errors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ValidationError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item in self.errors: + if _item: + _items.append(_item.to_dict()) + _dict['errors'] = _items + # set to None if errors (nullable) is None + # and model_fields_set contains the field + if self.errors is None and "errors" in self.model_fields_set: + _dict['errors'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ValidationError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "status": obj.get("status"), + "detail": obj.get("detail"), + "instance": obj.get("instance"), + "errors": [ValidationErrorItem.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/validation_error_item.py b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/validation_error_item.py new file mode 100644 index 00000000..64bbb303 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/models/validation_error_item.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ValidationErrorItem(BaseModel): + """ + ValidationErrorItem + """ # noqa: E501 + code: Optional[StrictStr] = Field(default=None, description="(Optional) A unique error type/code that can be referenced in the documentation for further details.") + var_field: Optional[StrictStr] = Field(default=None, description="Identifies the field that triggered this particular error.", alias="field") + message: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the error.") + __properties: ClassVar[List[str]] = ["code", "field", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ValidationErrorItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ValidationErrorItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "field": obj.get("field"), + "message": obj.get("message") + }) + return _obj + + diff --git a/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/py.typed b/thousandeyes-sdk-cloud-insights-integrations/src/thousandeyes_sdk/cloud_insights_integrations/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/thousandeyes-sdk-cloud-insights-integrations/test/__init__.py b/thousandeyes-sdk-cloud-insights-integrations/test/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/thousandeyes-sdk-cloud-insights-integrations/test/conftest.py b/thousandeyes-sdk-cloud-insights-integrations/test/conftest.py new file mode 100644 index 00000000..2edba7b3 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/test/conftest.py @@ -0,0 +1,7 @@ +import sys +from pathlib import Path + +_repo_root = Path(__file__).resolve().parents[2] +_core_test_support = _repo_root / "thousandeyes-sdk-core" / "test" +if str(_core_test_support) not in sys.path: + sys.path.insert(0, str(_core_test_support)) diff --git a/thousandeyes-sdk-cloud-insights-integrations/test/integration_test_utils.py b/thousandeyes-sdk-cloud-insights-integrations/test/integration_test_utils.py new file mode 100644 index 00000000..a0487467 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/test/integration_test_utils.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from thousandeyes_sdk.core.api_client import ApiClient +from thousandeyes_sdk.core.configuration import Configuration +from sdk_test_support.mock_server import ERROR_STATUS_HEADER, OPERATION_ID_HEADER, MockApiServer + +from .mock_manifest import OPERATION_MANIFEST + + +class IntegrationTestBase(unittest.TestCase): + def setUp(self) -> None: + self.server = MockApiServer(OPERATION_MANIFEST) + self.server.start() + configuration = Configuration(host=self.server.base_url, access_token="test-token") + self.api_client = ApiClient(configuration=configuration) + + def tearDown(self) -> None: + self.server.stop() + + def te_headers(self, operation_id: str, error_status=None): + headers = {OPERATION_ID_HEADER: operation_id} + if error_status is not None: + headers[ERROR_STATUS_HEADER] = error_status + return headers diff --git a/thousandeyes-sdk-cloud-insights-integrations/test/mock_manifest.py b/thousandeyes-sdk-cloud-insights-integrations/test/mock_manifest.py new file mode 100644 index 00000000..12f29268 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/test/mock_manifest.py @@ -0,0 +1,2012 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json + +from sdk_test_support.mock_server_types import ErrorResponseExpectation, OperationExpectation + +OPERATION_MANIFEST = { + + "get_aws_integration_policy_settings": OperationExpectation( + operation_id="get_aws_integration_policy_settings", + method="GET", + path="/cloud-insights/integration/aws/policy/settings", + path_param_examples={ + }, + success_status=200, + success_body=json.loads(""" + + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + + """), + + success_content_type="application/json", + + request_body_example=None, + error_responses={ + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "get_azure_integration_policy_settings": OperationExpectation( + operation_id="get_azure_integration_policy_settings", + method="GET", + path="/cloud-insights/integration/azure/policy/settings", + path_param_examples={ + }, + success_status=200, + success_body=json.loads(""" + + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + + """), + + success_content_type="application/json", + + request_body_example=None, + error_responses={ + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "update_aws_integration_policy_settings": OperationExpectation( + operation_id="update_aws_integration_policy_settings", + method="PUT", + path="/cloud-insights/integration/aws/policy/settings", + path_param_examples={ + }, + success_status=200, + success_body=json.loads(""" + + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + + """), + + success_content_type="application/json", + + request_body_example=json.loads(""" + + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + + """), + error_responses={ + + "400": ErrorResponseExpectation( + status=400, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + }"""), + content_type="application/json", + ), + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "update_azure_integration_policy_settings": OperationExpectation( + operation_id="update_azure_integration_policy_settings", + method="PUT", + path="/cloud-insights/integration/azure/policy/settings", + path_param_examples={ + }, + success_status=200, + success_body=json.loads(""" + + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + + """), + + success_content_type="application/json", + + request_body_example=json.loads(""" + + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + + """), + error_responses={ + + "400": ErrorResponseExpectation( + status=400, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + }"""), + content_type="application/json", + ), + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "create_aws_flow_logs_monitoring_integration": OperationExpectation( + operation_id="create_aws_flow_logs_monitoring_integration", + method="POST", + path="/cloud-insights/integration/aws/flow-logs", + path_param_examples={ + }, + success_status=201, + success_body=json.loads(""" + + { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + } + + """), + + success_content_type="application/json", + + request_body_example=json.loads(""" + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-flow-logs-ro", + "name" : "integration name", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ] + } + + """), + error_responses={ + + "400": ErrorResponseExpectation( + status=400, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + }"""), + content_type="application/json", + ), + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "create_aws_inventory_monitoring_integration": OperationExpectation( + operation_id="create_aws_inventory_monitoring_integration", + method="POST", + path="/cloud-insights/integration/aws/inventory", + path_param_examples={ + }, + success_status=201, + success_body=json.loads(""" + + { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + } + + """), + + success_content_type="application/json", + + request_body_example=json.loads(""" + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-inventory-ro", + "name" : "integration name" + } + + """), + error_responses={ + + "400": ErrorResponseExpectation( + status=400, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + }"""), + content_type="application/json", + ), + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "create_azure_flow_logs_monitoring_integration": OperationExpectation( + operation_id="create_azure_flow_logs_monitoring_integration", + method="POST", + path="/cloud-insights/integration/azure/flow-logs", + path_param_examples={ + }, + success_status=201, + success_body=json.loads(""" + + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """), + + success_content_type="application/json", + + request_body_example=json.loads(""" + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """), + error_responses={ + + "400": ErrorResponseExpectation( + status=400, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + }"""), + content_type="application/json", + ), + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "create_azure_inventory_monitoring_integration": OperationExpectation( + operation_id="create_azure_inventory_monitoring_integration", + method="POST", + path="/cloud-insights/integration/azure/inventory", + path_param_examples={ + }, + success_status=201, + success_body=json.loads(""" + + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """), + + success_content_type="application/json", + + request_body_example=json.loads(""" + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """), + error_responses={ + + "400": ErrorResponseExpectation( + status=400, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + }"""), + content_type="application/json", + ), + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "delete_aws_monitoring_integration": OperationExpectation( + operation_id="delete_aws_monitoring_integration", + method="DELETE", + path="/cloud-insights/integration/aws/{integrationId}", + path_param_examples={ + "integrationId": 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569', + }, + success_status=204, + success_body=None, + success_content_type="application/json", + request_body_example=None, + error_responses={ + + "400": ErrorResponseExpectation( + status=400, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + }"""), + content_type="application/json", + ), + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "delete_azure_monitoring_integration": OperationExpectation( + operation_id="delete_azure_monitoring_integration", + method="DELETE", + path="/cloud-insights/integration/azure/{integrationId}", + path_param_examples={ + "integrationId": 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569', + }, + success_status=204, + success_body=None, + success_content_type="application/json", + request_body_example=None, + error_responses={ + + "400": ErrorResponseExpectation( + status=400, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + }"""), + content_type="application/json", + ), + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "get_all_aws_monitoring_integrations": OperationExpectation( + operation_id="get_all_aws_monitoring_integrations", + method="GET", + path="/cloud-insights/integration/aws", + path_param_examples={ + }, + success_status=200, + success_body=json.loads(""" + + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "integrations" : [ { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + }, { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + } ] + } + + """), + + success_content_type="application/json", + + request_body_example=None, + error_responses={ + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "get_all_azure_monitoring_integrations": OperationExpectation( + operation_id="get_all_azure_monitoring_integrations", + method="GET", + path="/cloud-insights/integration/azure", + path_param_examples={ + }, + success_status=200, + success_body=json.loads(""" + + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "integrations" : [ { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + }, { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } ] + } + + """), + + success_content_type="application/json", + + request_body_example=None, + error_responses={ + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "get_aws_monitoring_integration": OperationExpectation( + operation_id="get_aws_monitoring_integration", + method="GET", + path="/cloud-insights/integration/aws/{integrationId}", + path_param_examples={ + "integrationId": 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569', + }, + success_status=200, + success_body=json.loads(""" + + { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + } + + """), + + success_content_type="application/json", + + request_body_example=None, + error_responses={ + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "get_azure_monitoring_integration": OperationExpectation( + operation_id="get_azure_monitoring_integration", + method="GET", + path="/cloud-insights/integration/azure/{integrationId}", + path_param_examples={ + "integrationId": 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569', + }, + success_status=200, + success_body=json.loads(""" + + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """), + + success_content_type="application/json", + + request_body_example=None, + error_responses={ + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "update_azure_flow_logs_monitoring_integration": OperationExpectation( + operation_id="update_azure_flow_logs_monitoring_integration", + method="PUT", + path="/cloud-insights/integration/azure/flow-logs/{integrationId}", + path_param_examples={ + "integrationId": 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569', + }, + success_status=200, + success_body=json.loads(""" + + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """), + + success_content_type="application/json", + + request_body_example=json.loads(""" + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """), + error_responses={ + + "400": ErrorResponseExpectation( + status=400, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + }"""), + content_type="application/json", + ), + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + + "update_azure_inventory_monitoring_integration": OperationExpectation( + operation_id="update_azure_inventory_monitoring_integration", + method="PUT", + path="/cloud-insights/integration/azure/inventory/{integrationId}", + path_param_examples={ + "integrationId": 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569', + }, + success_status=200, + success_body=json.loads(""" + + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """), + + success_content_type="application/json", + + request_body_example=json.loads(""" + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """), + error_responses={ + + "400": ErrorResponseExpectation( + status=400, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + }"""), + content_type="application/json", + ), + + "401": ErrorResponseExpectation( + status=401, + body=json.loads(""" + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + }"""), + content_type="application/json", + ), + + "403": ErrorResponseExpectation( + status=403, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "404": ErrorResponseExpectation( + status=404, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "429": ErrorResponseExpectation( + status=429, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + "500": ErrorResponseExpectation( + status=500, + body=json.loads(""" + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + }"""), + content_type="application/json", + ), + + }, + ), + +} diff --git a/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integration_policy_settings_api.py b/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integration_policy_settings_api.py new file mode 100644 index 00000000..221155fa --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integration_policy_settings_api.py @@ -0,0 +1,213 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.cloud_insights_integrations.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.cloud_insights_integrations.api.cloud_insights_integration_policy_settings_api import CloudInsightsIntegrationPolicySettingsApi + + +class TestCloudInsightsIntegrationPolicySettingsApi(unittest.TestCase): + """CloudInsightsIntegrationPolicySettingsApi unit test stubs""" + + def setUp(self) -> None: + self.api = CloudInsightsIntegrationPolicySettingsApi() + + def tearDown(self) -> None: + pass + + def test_get_aws_integration_policy_settings_models_validation(self) -> None: + """Test case for get_aws_integration_policy_settings request and response models""" + + response_body_json = """ + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AwsIntegrationPolicySetting.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_azure_integration_policy_settings_models_validation(self) -> None: + """Test case for get_azure_integration_policy_settings request and response models""" + + response_body_json = """ + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureIntegrationPolicySetting.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_aws_integration_policy_settings_models_validation(self) -> None: + """Test case for update_aws_integration_policy_settings request and response models""" + request_body_json = """ + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + """ + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AwsIntegrationPolicySetting.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AwsIntegrationPolicySetting.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_azure_integration_policy_settings_models_validation(self) -> None: + """Test case for update_azure_integration_policy_settings request and response models""" + request_body_json = """ + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + """ + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureIntegrationPolicySetting.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureIntegrationPolicySetting.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integration_policy_settings_api_integration.py b/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integration_policy_settings_api_integration.py new file mode 100644 index 00000000..cc4bff95 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integration_policy_settings_api_integration.py @@ -0,0 +1,1153 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.cloud_insights_integrations.models + +from thousandeyes_sdk.core.exceptions import ApiException +from thousandeyes_sdk.cloud_insights_integrations.api.cloud_insights_integration_policy_settings_api import CloudInsightsIntegrationPolicySettingsApi +from .integration_test_utils import IntegrationTestBase +from .test_utils import assert_constructed_model_matches_example_json + + +class TestCloudInsightsIntegrationPolicySettingsApiIntegration(IntegrationTestBase): + """CloudInsightsIntegrationPolicySettingsApi integration test stubs""" + + def setUp(self) -> None: + super().setUp() + self.api = CloudInsightsIntegrationPolicySettingsApi(self.api_client) + + + def test_get_aws_integration_policy_settings_happy_path(self) -> None: + """Integration test for get_aws_integration_policy_settings success path""" + aid = '1234' + response_body_json = """ + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + """ + expected_response = json.loads(response_body_json) + response = self.api.get_aws_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_aws_integration_policy_settings"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_get_aws_integration_policy_settings_error_401(self) -> None: + """Integration test for get_aws_integration_policy_settings error path (HTTP 401)""" + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.get_aws_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_aws_integration_policy_settings", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_aws_integration_policy_settings_error_403(self) -> None: + """Integration test for get_aws_integration_policy_settings error path (HTTP 403)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.get_aws_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_aws_integration_policy_settings", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_aws_integration_policy_settings_error_404(self) -> None: + """Integration test for get_aws_integration_policy_settings error path (HTTP 404)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.get_aws_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_aws_integration_policy_settings", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_aws_integration_policy_settings_error_429(self) -> None: + """Integration test for get_aws_integration_policy_settings error path (HTTP 429)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.get_aws_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_aws_integration_policy_settings", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_aws_integration_policy_settings_error_500(self) -> None: + """Integration test for get_aws_integration_policy_settings error path (HTTP 500)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.get_aws_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_aws_integration_policy_settings", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_get_azure_integration_policy_settings_happy_path(self) -> None: + """Integration test for get_azure_integration_policy_settings success path""" + aid = '1234' + response_body_json = """ + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + """ + expected_response = json.loads(response_body_json) + response = self.api.get_azure_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_azure_integration_policy_settings"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_get_azure_integration_policy_settings_error_401(self) -> None: + """Integration test for get_azure_integration_policy_settings error path (HTTP 401)""" + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.get_azure_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_azure_integration_policy_settings", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_azure_integration_policy_settings_error_403(self) -> None: + """Integration test for get_azure_integration_policy_settings error path (HTTP 403)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.get_azure_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_azure_integration_policy_settings", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_azure_integration_policy_settings_error_404(self) -> None: + """Integration test for get_azure_integration_policy_settings error path (HTTP 404)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.get_azure_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_azure_integration_policy_settings", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_azure_integration_policy_settings_error_429(self) -> None: + """Integration test for get_azure_integration_policy_settings error path (HTTP 429)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.get_azure_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_azure_integration_policy_settings", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_azure_integration_policy_settings_error_500(self) -> None: + """Integration test for get_azure_integration_policy_settings error path (HTTP 500)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.get_azure_integration_policy_settings( + + aid=aid, + + _headers=self.te_headers("get_azure_integration_policy_settings", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_update_aws_integration_policy_settings_happy_path(self) -> None: + """Integration test for update_aws_integration_policy_settings success path""" + request_body_json = """ + + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + + """ + aws_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AwsIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + response_body_json = """ + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + """ + expected_response = json.loads(response_body_json) + response = self.api.update_aws_integration_policy_settings( + + aws_integration_policy_setting=aws_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_aws_integration_policy_settings"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_update_aws_integration_policy_settings_error_400(self) -> None: + """Integration test for update_aws_integration_policy_settings error path (HTTP 400)""" + request_body_json = """ + + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + + """ + aws_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AwsIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(400) + ) as context: + self.api.update_aws_integration_policy_settings( + + aws_integration_policy_setting=aws_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_aws_integration_policy_settings", error_status="400"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_aws_integration_policy_settings_error_401(self) -> None: + """Integration test for update_aws_integration_policy_settings error path (HTTP 401)""" + request_body_json = """ + + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + + """ + aws_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AwsIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.update_aws_integration_policy_settings( + + aws_integration_policy_setting=aws_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_aws_integration_policy_settings", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_aws_integration_policy_settings_error_403(self) -> None: + """Integration test for update_aws_integration_policy_settings error path (HTTP 403)""" + request_body_json = """ + + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + + """ + aws_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AwsIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.update_aws_integration_policy_settings( + + aws_integration_policy_setting=aws_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_aws_integration_policy_settings", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_aws_integration_policy_settings_error_404(self) -> None: + """Integration test for update_aws_integration_policy_settings error path (HTTP 404)""" + request_body_json = """ + + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + + """ + aws_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AwsIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.update_aws_integration_policy_settings( + + aws_integration_policy_setting=aws_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_aws_integration_policy_settings", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_aws_integration_policy_settings_error_429(self) -> None: + """Integration test for update_aws_integration_policy_settings error path (HTTP 429)""" + request_body_json = """ + + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + + """ + aws_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AwsIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.update_aws_integration_policy_settings( + + aws_integration_policy_setting=aws_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_aws_integration_policy_settings", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_aws_integration_policy_settings_error_500(self) -> None: + """Integration test for update_aws_integration_policy_settings error path (HTTP 500)""" + request_body_json = """ + + { + "enabledRegions" : [ "us-east-1", "eu-west-1", "ap-southeast-2" ], + "enabledResourceGroupTypes" : [ "ec2", "s3-bucket", "global-network" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "enabledCloudtrail" : true + } + + """ + aws_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AwsIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.update_aws_integration_policy_settings( + + aws_integration_policy_setting=aws_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_aws_integration_policy_settings", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_update_azure_integration_policy_settings_happy_path(self) -> None: + """Integration test for update_azure_integration_policy_settings success path""" + request_body_json = """ + + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + + """ + azure_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AzureIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + response_body_json = """ + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + """ + expected_response = json.loads(response_body_json) + response = self.api.update_azure_integration_policy_settings( + + azure_integration_policy_setting=azure_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_azure_integration_policy_settings"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_update_azure_integration_policy_settings_error_400(self) -> None: + """Integration test for update_azure_integration_policy_settings error path (HTTP 400)""" + request_body_json = """ + + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + + """ + azure_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AzureIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(400) + ) as context: + self.api.update_azure_integration_policy_settings( + + azure_integration_policy_setting=azure_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_azure_integration_policy_settings", error_status="400"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_integration_policy_settings_error_401(self) -> None: + """Integration test for update_azure_integration_policy_settings error path (HTTP 401)""" + request_body_json = """ + + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + + """ + azure_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AzureIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.update_azure_integration_policy_settings( + + azure_integration_policy_setting=azure_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_azure_integration_policy_settings", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_integration_policy_settings_error_403(self) -> None: + """Integration test for update_azure_integration_policy_settings error path (HTTP 403)""" + request_body_json = """ + + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + + """ + azure_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AzureIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.update_azure_integration_policy_settings( + + azure_integration_policy_setting=azure_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_azure_integration_policy_settings", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_integration_policy_settings_error_404(self) -> None: + """Integration test for update_azure_integration_policy_settings error path (HTTP 404)""" + request_body_json = """ + + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + + """ + azure_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AzureIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.update_azure_integration_policy_settings( + + azure_integration_policy_setting=azure_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_azure_integration_policy_settings", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_integration_policy_settings_error_429(self) -> None: + """Integration test for update_azure_integration_policy_settings error path (HTTP 429)""" + request_body_json = """ + + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + + """ + azure_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AzureIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.update_azure_integration_policy_settings( + + azure_integration_policy_setting=azure_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_azure_integration_policy_settings", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_integration_policy_settings_error_500(self) -> None: + """Integration test for update_azure_integration_policy_settings error path (HTTP 500)""" + request_body_json = """ + + { + "enabledResourceGroupTypes" : [ "networking", "virtual-wan", "traffic-manager" ], + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "subscriptionsPolicy" : { + "rules" : [ { + "field" : "subscription-name", + "pattern" : "^prod-.*$", + "action" : "include" + }, { + "field" : "subscription-id", + "pattern" : "3145d332-e1c9-4670-a672-12e17d4f627e", + "action" : "exclude" + } ], + "defaultAction" : "exclude" + } + } + + """ + azure_integration_policy_setting = thousandeyes_sdk.cloud_insights_integrations.models.AzureIntegrationPolicySetting.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.update_azure_integration_policy_settings( + + azure_integration_policy_setting=azure_integration_policy_setting, + + aid=aid, + + _headers=self.te_headers("update_azure_integration_policy_settings", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integrations_api.py b/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integrations_api.py new file mode 100644 index 00000000..92e77cc1 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integrations_api.py @@ -0,0 +1,493 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.cloud_insights_integrations.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.cloud_insights_integrations.api.cloud_insights_integrations_api import CloudInsightsIntegrationsApi + + +class TestCloudInsightsIntegrationsApi(unittest.TestCase): + """CloudInsightsIntegrationsApi unit test stubs""" + + def setUp(self) -> None: + self.api = CloudInsightsIntegrationsApi() + + def tearDown(self) -> None: + pass + + def test_create_aws_flow_logs_monitoring_integration_models_validation(self) -> None: + """Test case for create_aws_flow_logs_monitoring_integration request and response models""" + request_body_json = """ + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-flow-logs-ro", + "name" : "integration name", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ] + } + """ + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AwsFlowLogsIntegrationRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AwsMonitoringIntegration.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_create_aws_inventory_monitoring_integration_models_validation(self) -> None: + """Test case for create_aws_inventory_monitoring_integration request and response models""" + request_body_json = """ + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-inventory-ro", + "name" : "integration name" + } + """ + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AwsInventoryIntegrationRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AwsMonitoringIntegration.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_create_azure_flow_logs_monitoring_integration_models_validation(self) -> None: + """Test case for create_azure_flow_logs_monitoring_integration request and response models""" + request_body_json = """ + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + """ + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureMonitoringIntegration.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_create_azure_inventory_monitoring_integration_models_validation(self) -> None: + """Test case for create_azure_inventory_monitoring_integration request and response models""" + request_body_json = """ + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + """ + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureMonitoringIntegration.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_delete_aws_monitoring_integration_models_validation(self) -> None: + """Test case for delete_aws_monitoring_integration request and response models""" + + + def test_delete_azure_monitoring_integration_models_validation(self) -> None: + """Test case for delete_azure_monitoring_integration request and response models""" + + + def test_get_all_aws_monitoring_integrations_models_validation(self) -> None: + """Test case for get_all_aws_monitoring_integrations request and response models""" + + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "integrations" : [ { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + }, { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AwsMonitoringIntegrations.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_all_azure_monitoring_integrations_models_validation(self) -> None: + """Test case for get_all_azure_monitoring_integrations request and response models""" + + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "integrations" : [ { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + }, { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureMonitoringIntegrations.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_aws_flowlogs_monitoring_integration_policies_models_validation(self) -> None: + """Test case for get_aws_flowlogs_monitoring_integration_policies request and response models""" + + response_body_json = """ + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.str.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_aws_inventory_monitoring_integration_policies_models_validation(self) -> None: + """Test case for get_aws_inventory_monitoring_integration_policies request and response models""" + + response_body_json = """ + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.str.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_aws_monitoring_integration_models_validation(self) -> None: + """Test case for get_aws_monitoring_integration request and response models""" + + response_body_json = """ + { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AwsMonitoringIntegration.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_azure_monitoring_integration_models_validation(self) -> None: + """Test case for get_azure_monitoring_integration request and response models""" + + response_body_json = """ + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureMonitoringIntegration.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_azure_flow_logs_monitoring_integration_models_validation(self) -> None: + """Test case for update_azure_flow_logs_monitoring_integration request and response models""" + request_body_json = """ + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + """ + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureMonitoringIntegration.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_update_azure_inventory_monitoring_integration_models_validation(self) -> None: + """Test case for update_azure_inventory_monitoring_integration request and response models""" + request_body_json = """ + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + """ + + request_loaded_json = json.loads(request_body_json) + request_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + assert_constructed_model_matches_example_json(request_from_json, request_loaded_json) + + response_body_json = """ + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.cloud_insights_integrations.models.AzureMonitoringIntegration.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integrations_api_integration.py b/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integrations_api_integration.py new file mode 100644 index 00000000..4caf6065 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/test/test_cloud_insights_integrations_api_integration.py @@ -0,0 +1,2903 @@ +# coding: utf-8 + +""" + Cloud Insights Integrations API + + **Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance. The Cloud Insights Integrations API lets you programmatically manage **AWS** and **Azure** monitoring integrations in ThousandEyes. ### What You Can Do - **List** all integrations. - **Get** details for a specific integration. - **Delete** an existing integration. - **Create** integrations for: - **AWS**: inventory monitoring and flow logs monitoring. - **Azure**: inventory monitoring and flow logs monitoring. - **Update** integrations for: - **Azure**: inventory monitoring and flow logs monitoring. - **Fetch AWS IAM policy documents** required to configure AWS inventory and flow-logs integrations. - **Retrieve** the current AWS and Azure integration policy settings to understand which AWS and Azure resource groups, AWS regions, Azure subscription rules are enabled and whether CloudTrail is enabled for Cloud Insights for inventory monitoring. - **Update** policy settings to change the approved AWS resource groups, AWS regions, and Azure subscription rules that ThousandEyes should inventory. ### Scope and Tenancy All operations are scoped to the authenticated account group. Responses include only resources associated with that group. ### Payloads and formats - **Requests:** `application/json` - **Responses:** primarily `application/hal+json` for resource representations and `application/json` for policy documents. - HAL responses include `_links` with a `self` relation for direct navigation. ### Integration Types - **Inventory monitoring** - AWS: reads inventory and network topology via read-only IAM permissions. - Azure: authenticates with a Service Principal to read inventory and network topology. - **Flow logs monitoring** - AWS: reads flow logs from S3 buckets and uses SNS for notifications. - Azure: reads flow logs via **Service Bus Queue** (`serviceBusQueueUrl`). ### Policy Helpers (AWS) Dedicated endpoints return **Trusted Policy**, **Permissions Policy**, and **SNS Topic Access Policy** documents to simplify role setup for inventory and flow logs integrations. ### Notes - All example values in this specification are **fictitious**. For more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.cloud_insights_integrations.models + +from thousandeyes_sdk.core.exceptions import ApiException +from thousandeyes_sdk.cloud_insights_integrations.api.cloud_insights_integrations_api import CloudInsightsIntegrationsApi +from .integration_test_utils import IntegrationTestBase +from .test_utils import assert_constructed_model_matches_example_json + + +class TestCloudInsightsIntegrationsApiIntegration(IntegrationTestBase): + """CloudInsightsIntegrationsApi integration test stubs""" + + def setUp(self) -> None: + super().setUp() + self.api = CloudInsightsIntegrationsApi(self.api_client) + + + def test_create_aws_flow_logs_monitoring_integration_happy_path(self) -> None: + """Integration test for create_aws_flow_logs_monitoring_integration success path""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-flow-logs-ro", + "name" : "integration name", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ] + } + + """ + aws_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + response_body_json = """ + { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + } + """ + expected_response = json.loads(response_body_json) + response = self.api.create_aws_flow_logs_monitoring_integration( + + aws_flow_logs_integration_request=aws_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_flow_logs_monitoring_integration"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_create_aws_flow_logs_monitoring_integration_error_400(self) -> None: + """Integration test for create_aws_flow_logs_monitoring_integration error path (HTTP 400)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-flow-logs-ro", + "name" : "integration name", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ] + } + + """ + aws_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(400) + ) as context: + self.api.create_aws_flow_logs_monitoring_integration( + + aws_flow_logs_integration_request=aws_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_flow_logs_monitoring_integration", error_status="400"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_aws_flow_logs_monitoring_integration_error_401(self) -> None: + """Integration test for create_aws_flow_logs_monitoring_integration error path (HTTP 401)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-flow-logs-ro", + "name" : "integration name", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ] + } + + """ + aws_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.create_aws_flow_logs_monitoring_integration( + + aws_flow_logs_integration_request=aws_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_flow_logs_monitoring_integration", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_aws_flow_logs_monitoring_integration_error_403(self) -> None: + """Integration test for create_aws_flow_logs_monitoring_integration error path (HTTP 403)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-flow-logs-ro", + "name" : "integration name", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ] + } + + """ + aws_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.create_aws_flow_logs_monitoring_integration( + + aws_flow_logs_integration_request=aws_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_flow_logs_monitoring_integration", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_aws_flow_logs_monitoring_integration_error_404(self) -> None: + """Integration test for create_aws_flow_logs_monitoring_integration error path (HTTP 404)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-flow-logs-ro", + "name" : "integration name", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ] + } + + """ + aws_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.create_aws_flow_logs_monitoring_integration( + + aws_flow_logs_integration_request=aws_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_flow_logs_monitoring_integration", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_aws_flow_logs_monitoring_integration_error_429(self) -> None: + """Integration test for create_aws_flow_logs_monitoring_integration error path (HTTP 429)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-flow-logs-ro", + "name" : "integration name", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ] + } + + """ + aws_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.create_aws_flow_logs_monitoring_integration( + + aws_flow_logs_integration_request=aws_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_flow_logs_monitoring_integration", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_aws_flow_logs_monitoring_integration_error_500(self) -> None: + """Integration test for create_aws_flow_logs_monitoring_integration error path (HTTP 500)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-flow-logs-ro", + "name" : "integration name", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ] + } + + """ + aws_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.create_aws_flow_logs_monitoring_integration( + + aws_flow_logs_integration_request=aws_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_flow_logs_monitoring_integration", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_create_aws_inventory_monitoring_integration_happy_path(self) -> None: + """Integration test for create_aws_inventory_monitoring_integration success path""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-inventory-ro", + "name" : "integration name" + } + + """ + aws_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + response_body_json = """ + { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + } + """ + expected_response = json.loads(response_body_json) + response = self.api.create_aws_inventory_monitoring_integration( + + aws_inventory_integration_request=aws_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_inventory_monitoring_integration"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_create_aws_inventory_monitoring_integration_error_400(self) -> None: + """Integration test for create_aws_inventory_monitoring_integration error path (HTTP 400)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-inventory-ro", + "name" : "integration name" + } + + """ + aws_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(400) + ) as context: + self.api.create_aws_inventory_monitoring_integration( + + aws_inventory_integration_request=aws_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_inventory_monitoring_integration", error_status="400"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_aws_inventory_monitoring_integration_error_401(self) -> None: + """Integration test for create_aws_inventory_monitoring_integration error path (HTTP 401)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-inventory-ro", + "name" : "integration name" + } + + """ + aws_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.create_aws_inventory_monitoring_integration( + + aws_inventory_integration_request=aws_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_inventory_monitoring_integration", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_aws_inventory_monitoring_integration_error_403(self) -> None: + """Integration test for create_aws_inventory_monitoring_integration error path (HTTP 403)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-inventory-ro", + "name" : "integration name" + } + + """ + aws_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.create_aws_inventory_monitoring_integration( + + aws_inventory_integration_request=aws_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_inventory_monitoring_integration", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_aws_inventory_monitoring_integration_error_404(self) -> None: + """Integration test for create_aws_inventory_monitoring_integration error path (HTTP 404)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-inventory-ro", + "name" : "integration name" + } + + """ + aws_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.create_aws_inventory_monitoring_integration( + + aws_inventory_integration_request=aws_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_inventory_monitoring_integration", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_aws_inventory_monitoring_integration_error_429(self) -> None: + """Integration test for create_aws_inventory_monitoring_integration error path (HTTP 429)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-inventory-ro", + "name" : "integration name" + } + + """ + aws_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.create_aws_inventory_monitoring_integration( + + aws_inventory_integration_request=aws_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_inventory_monitoring_integration", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_aws_inventory_monitoring_integration_error_500(self) -> None: + """Integration test for create_aws_inventory_monitoring_integration error path (HTTP 500)""" + request_body_json = """ + + { + "roleArn" : "arn:aws:iam::01234567890:role/aws-inventory-ro", + "name" : "integration name" + } + + """ + aws_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AwsInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.create_aws_inventory_monitoring_integration( + + aws_inventory_integration_request=aws_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_aws_inventory_monitoring_integration", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_create_azure_flow_logs_monitoring_integration_happy_path(self) -> None: + """Integration test for create_azure_flow_logs_monitoring_integration success path""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + response_body_json = """ + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + """ + expected_response = json.loads(response_body_json) + response = self.api.create_azure_flow_logs_monitoring_integration( + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_flow_logs_monitoring_integration"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_create_azure_flow_logs_monitoring_integration_error_400(self) -> None: + """Integration test for create_azure_flow_logs_monitoring_integration error path (HTTP 400)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(400) + ) as context: + self.api.create_azure_flow_logs_monitoring_integration( + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_flow_logs_monitoring_integration", error_status="400"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_azure_flow_logs_monitoring_integration_error_401(self) -> None: + """Integration test for create_azure_flow_logs_monitoring_integration error path (HTTP 401)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.create_azure_flow_logs_monitoring_integration( + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_flow_logs_monitoring_integration", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_azure_flow_logs_monitoring_integration_error_403(self) -> None: + """Integration test for create_azure_flow_logs_monitoring_integration error path (HTTP 403)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.create_azure_flow_logs_monitoring_integration( + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_flow_logs_monitoring_integration", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_azure_flow_logs_monitoring_integration_error_404(self) -> None: + """Integration test for create_azure_flow_logs_monitoring_integration error path (HTTP 404)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.create_azure_flow_logs_monitoring_integration( + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_flow_logs_monitoring_integration", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_azure_flow_logs_monitoring_integration_error_429(self) -> None: + """Integration test for create_azure_flow_logs_monitoring_integration error path (HTTP 429)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.create_azure_flow_logs_monitoring_integration( + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_flow_logs_monitoring_integration", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_azure_flow_logs_monitoring_integration_error_500(self) -> None: + """Integration test for create_azure_flow_logs_monitoring_integration error path (HTTP 500)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.create_azure_flow_logs_monitoring_integration( + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_flow_logs_monitoring_integration", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_create_azure_inventory_monitoring_integration_happy_path(self) -> None: + """Integration test for create_azure_inventory_monitoring_integration success path""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + response_body_json = """ + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + """ + expected_response = json.loads(response_body_json) + response = self.api.create_azure_inventory_monitoring_integration( + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_inventory_monitoring_integration"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_create_azure_inventory_monitoring_integration_error_400(self) -> None: + """Integration test for create_azure_inventory_monitoring_integration error path (HTTP 400)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(400) + ) as context: + self.api.create_azure_inventory_monitoring_integration( + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_inventory_monitoring_integration", error_status="400"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_azure_inventory_monitoring_integration_error_401(self) -> None: + """Integration test for create_azure_inventory_monitoring_integration error path (HTTP 401)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.create_azure_inventory_monitoring_integration( + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_inventory_monitoring_integration", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_azure_inventory_monitoring_integration_error_403(self) -> None: + """Integration test for create_azure_inventory_monitoring_integration error path (HTTP 403)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.create_azure_inventory_monitoring_integration( + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_inventory_monitoring_integration", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_azure_inventory_monitoring_integration_error_404(self) -> None: + """Integration test for create_azure_inventory_monitoring_integration error path (HTTP 404)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.create_azure_inventory_monitoring_integration( + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_inventory_monitoring_integration", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_azure_inventory_monitoring_integration_error_429(self) -> None: + """Integration test for create_azure_inventory_monitoring_integration error path (HTTP 429)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.create_azure_inventory_monitoring_integration( + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_inventory_monitoring_integration", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_create_azure_inventory_monitoring_integration_error_500(self) -> None: + """Integration test for create_azure_inventory_monitoring_integration error path (HTTP 500)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.create_azure_inventory_monitoring_integration( + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("create_azure_inventory_monitoring_integration", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_delete_aws_monitoring_integration_happy_path(self) -> None: + """Integration test for delete_aws_monitoring_integration success path""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + response = self.api.delete_aws_monitoring_integration_with_http_info( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_aws_monitoring_integration"), + ) + self.assertEqual(204, response.status_code) + self.assertIsNone(response.data) + + + def test_delete_aws_monitoring_integration_error_400(self) -> None: + """Integration test for delete_aws_monitoring_integration error path (HTTP 400)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(400) + ) as context: + self.api.delete_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_aws_monitoring_integration", error_status="400"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_delete_aws_monitoring_integration_error_401(self) -> None: + """Integration test for delete_aws_monitoring_integration error path (HTTP 401)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.delete_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_aws_monitoring_integration", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_delete_aws_monitoring_integration_error_403(self) -> None: + """Integration test for delete_aws_monitoring_integration error path (HTTP 403)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.delete_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_aws_monitoring_integration", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_delete_aws_monitoring_integration_error_404(self) -> None: + """Integration test for delete_aws_monitoring_integration error path (HTTP 404)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.delete_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_aws_monitoring_integration", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_delete_aws_monitoring_integration_error_429(self) -> None: + """Integration test for delete_aws_monitoring_integration error path (HTTP 429)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.delete_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_aws_monitoring_integration", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_delete_aws_monitoring_integration_error_500(self) -> None: + """Integration test for delete_aws_monitoring_integration error path (HTTP 500)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.delete_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_aws_monitoring_integration", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_delete_azure_monitoring_integration_happy_path(self) -> None: + """Integration test for delete_azure_monitoring_integration success path""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + response = self.api.delete_azure_monitoring_integration_with_http_info( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_azure_monitoring_integration"), + ) + self.assertEqual(204, response.status_code) + self.assertIsNone(response.data) + + + def test_delete_azure_monitoring_integration_error_400(self) -> None: + """Integration test for delete_azure_monitoring_integration error path (HTTP 400)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(400) + ) as context: + self.api.delete_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_azure_monitoring_integration", error_status="400"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_delete_azure_monitoring_integration_error_401(self) -> None: + """Integration test for delete_azure_monitoring_integration error path (HTTP 401)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.delete_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_azure_monitoring_integration", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_delete_azure_monitoring_integration_error_403(self) -> None: + """Integration test for delete_azure_monitoring_integration error path (HTTP 403)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.delete_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_azure_monitoring_integration", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_delete_azure_monitoring_integration_error_404(self) -> None: + """Integration test for delete_azure_monitoring_integration error path (HTTP 404)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.delete_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_azure_monitoring_integration", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_delete_azure_monitoring_integration_error_429(self) -> None: + """Integration test for delete_azure_monitoring_integration error path (HTTP 429)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.delete_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_azure_monitoring_integration", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_delete_azure_monitoring_integration_error_500(self) -> None: + """Integration test for delete_azure_monitoring_integration error path (HTTP 500)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.delete_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("delete_azure_monitoring_integration", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_get_all_aws_monitoring_integrations_happy_path(self) -> None: + """Integration test for get_all_aws_monitoring_integrations success path""" + aid = '1234' + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "integrations" : [ { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + }, { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + } ] + } + """ + expected_response = json.loads(response_body_json) + response = self.api.get_all_aws_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_aws_monitoring_integrations"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_get_all_aws_monitoring_integrations_error_401(self) -> None: + """Integration test for get_all_aws_monitoring_integrations error path (HTTP 401)""" + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.get_all_aws_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_aws_monitoring_integrations", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_all_aws_monitoring_integrations_error_403(self) -> None: + """Integration test for get_all_aws_monitoring_integrations error path (HTTP 403)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.get_all_aws_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_aws_monitoring_integrations", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_all_aws_monitoring_integrations_error_404(self) -> None: + """Integration test for get_all_aws_monitoring_integrations error path (HTTP 404)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.get_all_aws_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_aws_monitoring_integrations", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_all_aws_monitoring_integrations_error_429(self) -> None: + """Integration test for get_all_aws_monitoring_integrations error path (HTTP 429)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.get_all_aws_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_aws_monitoring_integrations", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_all_aws_monitoring_integrations_error_500(self) -> None: + """Integration test for get_all_aws_monitoring_integrations error path (HTTP 500)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.get_all_aws_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_aws_monitoring_integrations", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_get_all_azure_monitoring_integrations_happy_path(self) -> None: + """Integration test for get_all_azure_monitoring_integrations success path""" + aid = '1234' + response_body_json = """ + { + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "integrations" : [ { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + }, { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } ] + } + """ + expected_response = json.loads(response_body_json) + response = self.api.get_all_azure_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_azure_monitoring_integrations"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_get_all_azure_monitoring_integrations_error_401(self) -> None: + """Integration test for get_all_azure_monitoring_integrations error path (HTTP 401)""" + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.get_all_azure_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_azure_monitoring_integrations", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_all_azure_monitoring_integrations_error_403(self) -> None: + """Integration test for get_all_azure_monitoring_integrations error path (HTTP 403)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.get_all_azure_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_azure_monitoring_integrations", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_all_azure_monitoring_integrations_error_404(self) -> None: + """Integration test for get_all_azure_monitoring_integrations error path (HTTP 404)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.get_all_azure_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_azure_monitoring_integrations", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_all_azure_monitoring_integrations_error_429(self) -> None: + """Integration test for get_all_azure_monitoring_integrations error path (HTTP 429)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.get_all_azure_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_azure_monitoring_integrations", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_all_azure_monitoring_integrations_error_500(self) -> None: + """Integration test for get_all_azure_monitoring_integrations error path (HTTP 500)""" + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.get_all_azure_monitoring_integrations( + + aid=aid, + + _headers=self.te_headers("get_all_azure_monitoring_integrations", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_get_aws_monitoring_integration_happy_path(self) -> None: + """Integration test for get_aws_monitoring_integration success path""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + response_body_json = """ + { + "monitoringType" : "inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "roleArn" : "arn:aws:iam::01234567890:role/aws-monitoring-ro", + "name" : "integration name", + "externalId" : "37d8f861cffd34212b5a34466564da1f80b01a30", + "snsTopicsArns" : [ "arn:aws:sns:us-east-1:01234567890:SNS-Topic-US", "arn:aws:sns:eu-central-1:01234567890:SNS-Topic-EU" ], + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569" + } + """ + expected_response = json.loads(response_body_json) + response = self.api.get_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_aws_monitoring_integration"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_get_aws_monitoring_integration_error_401(self) -> None: + """Integration test for get_aws_monitoring_integration error path (HTTP 401)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.get_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_aws_monitoring_integration", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_aws_monitoring_integration_error_403(self) -> None: + """Integration test for get_aws_monitoring_integration error path (HTTP 403)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.get_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_aws_monitoring_integration", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_aws_monitoring_integration_error_404(self) -> None: + """Integration test for get_aws_monitoring_integration error path (HTTP 404)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.get_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_aws_monitoring_integration", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_aws_monitoring_integration_error_429(self) -> None: + """Integration test for get_aws_monitoring_integration error path (HTTP 429)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.get_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_aws_monitoring_integration", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_aws_monitoring_integration_error_500(self) -> None: + """Integration test for get_aws_monitoring_integration error path (HTTP 500)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.get_aws_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_aws_monitoring_integration", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_get_azure_monitoring_integration_happy_path(self) -> None: + """Integration test for get_azure_monitoring_integration success path""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + response_body_json = """ + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + """ + expected_response = json.loads(response_body_json) + response = self.api.get_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_azure_monitoring_integration"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_get_azure_monitoring_integration_error_401(self) -> None: + """Integration test for get_azure_monitoring_integration error path (HTTP 401)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.get_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_azure_monitoring_integration", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_azure_monitoring_integration_error_403(self) -> None: + """Integration test for get_azure_monitoring_integration error path (HTTP 403)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.get_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_azure_monitoring_integration", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_azure_monitoring_integration_error_404(self) -> None: + """Integration test for get_azure_monitoring_integration error path (HTTP 404)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.get_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_azure_monitoring_integration", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_azure_monitoring_integration_error_429(self) -> None: + """Integration test for get_azure_monitoring_integration error path (HTTP 429)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.get_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_azure_monitoring_integration", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_get_azure_monitoring_integration_error_500(self) -> None: + """Integration test for get_azure_monitoring_integration error path (HTTP 500)""" + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.get_azure_monitoring_integration( + + integration_id=integration_id, + + aid=aid, + + _headers=self.te_headers("get_azure_monitoring_integration", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_update_azure_flow_logs_monitoring_integration_happy_path(self) -> None: + """Integration test for update_azure_flow_logs_monitoring_integration success path""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + response_body_json = """ + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + """ + expected_response = json.loads(response_body_json) + response = self.api.update_azure_flow_logs_monitoring_integration( + + integration_id=integration_id, + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_flow_logs_monitoring_integration"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_update_azure_flow_logs_monitoring_integration_error_400(self) -> None: + """Integration test for update_azure_flow_logs_monitoring_integration error path (HTTP 400)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(400) + ) as context: + self.api.update_azure_flow_logs_monitoring_integration( + + integration_id=integration_id, + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_flow_logs_monitoring_integration", error_status="400"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_flow_logs_monitoring_integration_error_401(self) -> None: + """Integration test for update_azure_flow_logs_monitoring_integration error path (HTTP 401)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.update_azure_flow_logs_monitoring_integration( + + integration_id=integration_id, + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_flow_logs_monitoring_integration", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_flow_logs_monitoring_integration_error_403(self) -> None: + """Integration test for update_azure_flow_logs_monitoring_integration error path (HTTP 403)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.update_azure_flow_logs_monitoring_integration( + + integration_id=integration_id, + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_flow_logs_monitoring_integration", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_flow_logs_monitoring_integration_error_404(self) -> None: + """Integration test for update_azure_flow_logs_monitoring_integration error path (HTTP 404)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.update_azure_flow_logs_monitoring_integration( + + integration_id=integration_id, + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_flow_logs_monitoring_integration", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_flow_logs_monitoring_integration_error_429(self) -> None: + """Integration test for update_azure_flow_logs_monitoring_integration error path (HTTP 429)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.update_azure_flow_logs_monitoring_integration( + + integration_id=integration_id, + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_flow_logs_monitoring_integration", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_flow_logs_monitoring_integration_error_500(self) -> None: + """Integration test for update_azure_flow_logs_monitoring_integration error path (HTTP 500)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + + """ + azure_flow_logs_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureFlowLogsIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.update_azure_flow_logs_monitoring_integration( + + integration_id=integration_id, + + azure_flow_logs_integration_request=azure_flow_logs_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_flow_logs_monitoring_integration", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + def test_update_azure_inventory_monitoring_integration_happy_path(self) -> None: + """Integration test for update_azure_inventory_monitoring_integration success path""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + response_body_json = """ + { + "password" : "********", + "monitoringType" : "azure-inventory-monitoring", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44", + "serviceBusQueueUrl" : "https://your-service-bus-namespace.servicebus.windows.net/your-queue-name" + } + """ + expected_response = json.loads(response_body_json) + response = self.api.update_azure_inventory_monitoring_integration( + + integration_id=integration_id, + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_inventory_monitoring_integration"), + ) + assert_constructed_model_matches_example_json(response, expected_response) + + + def test_update_azure_inventory_monitoring_integration_error_400(self) -> None: + """Integration test for update_azure_inventory_monitoring_integration error path (HTTP 400)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "errors" : [ { + "code" : "code", + "field" : "field", + "message" : "message" + }, { + "code" : "code", + "field" : "field", + "message" : "message" + } ], + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(400) + ) as context: + self.api.update_azure_inventory_monitoring_integration( + + integration_id=integration_id, + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_inventory_monitoring_integration", error_status="400"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_inventory_monitoring_integration_error_401(self) -> None: + """Integration test for update_azure_inventory_monitoring_integration error path (HTTP 401)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "error_description" : "Invalid access token", + "error" : "invalid_token" + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(401) + ) as context: + self.api.update_azure_inventory_monitoring_integration( + + integration_id=integration_id, + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_inventory_monitoring_integration", error_status="401"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_inventory_monitoring_integration_error_403(self) -> None: + """Integration test for update_azure_inventory_monitoring_integration error path (HTTP 403)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(403) + ) as context: + self.api.update_azure_inventory_monitoring_integration( + + integration_id=integration_id, + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_inventory_monitoring_integration", error_status="403"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_inventory_monitoring_integration_error_404(self) -> None: + """Integration test for update_azure_inventory_monitoring_integration error path (HTTP 404)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(404) + ) as context: + self.api.update_azure_inventory_monitoring_integration( + + integration_id=integration_id, + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_inventory_monitoring_integration", error_status="404"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_inventory_monitoring_integration_error_429(self) -> None: + """Integration test for update_azure_inventory_monitoring_integration error path (HTTP 429)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(429) + ) as context: + self.api.update_azure_inventory_monitoring_integration( + + integration_id=integration_id, + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_inventory_monitoring_integration", error_status="429"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + def test_update_azure_inventory_monitoring_integration_error_500(self) -> None: + """Integration test for update_azure_inventory_monitoring_integration error path (HTTP 500)""" + request_body_json = """ + + { + "password" : "p9z4Q~U7LkdX1yZr3TcB6fJqG8aM0sDeT5R9hVnKw", + "appId" : "2f9b2a1c-6d87-4c92-9d51-37efc93c0a4f", + "name" : "integration name", + "azureTenantId" : "e3a72c9b-42b1-4e0b-9b9f-7f6a3b2a1c44" + } + + """ + azure_inventory_integration_request = thousandeyes_sdk.cloud_insights_integrations.models.AzureInventoryIntegrationRequest.from_json(request_body_json) + integration_id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' + aid = '1234' + error_body_json = """ + { + "instance" : "instance", + "detail" : "detail", + "type" : "type", + "title" : "title", + "status" : 0 + } + """ + expected_error = json.loads(error_body_json) + with self.assertRaises( + ApiException.exception_class_for_http_status(500) + ) as context: + self.api.update_azure_inventory_monitoring_integration( + + integration_id=integration_id, + + azure_inventory_integration_request=azure_inventory_integration_request, + + aid=aid, + + _headers=self.te_headers("update_azure_inventory_monitoring_integration", error_status="500"), + ) + assert_constructed_model_matches_example_json(context.exception.data, expected_error) + + + + + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-cloud-insights-integrations/test/test_utils.py b/thousandeyes-sdk-cloud-insights-integrations/test/test_utils.py new file mode 100644 index 00000000..37913f62 --- /dev/null +++ b/thousandeyes-sdk-cloud-insights-integrations/test/test_utils.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +import json +import unittest +from typing import Any + +from pydantic import BaseModel + + +def _project_onto_constructed(expected: Any, constructed: Any) -> Any: + """Keep only example fields that appear in the constructed model output.""" + if isinstance(constructed, dict): + if not isinstance(expected, dict): + return expected + return { + key: _project_onto_constructed(expected.get(key), value) + for key, value in constructed.items() + } + if isinstance(constructed, list): + if not isinstance(expected, list): + return expected + return [ + _project_onto_constructed(expected[index], value) + for index, value in enumerate(constructed) + ] + return expected + + +def assert_constructed_model_matches_example_json(model: BaseModel, loaded_json: dict): + test_case = unittest.TestCase() + test_case.maxDiff = None + test_case.assertIsNotNone(model) + constructed_json = json.loads(model.to_json()) + projected_loaded_json = _project_onto_constructed(loaded_json, constructed_json) + sorted_loaded_json = json.dumps(projected_loaded_json, sort_keys=True) + sorted_constructed_json = json.dumps(constructed_json, sort_keys=True) + test_case.assertEqual(sorted_loaded_json, sorted_constructed_json)