mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2026-09-19 16:13:55 +00:00
38 lines
3.4 KiB
Python
38 lines
3.4 KiB
Python
# 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
|