mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2026-09-19 16:13:55 +00:00
Some checks failed
Python CI / build (push) Has been cancelled
Co-authored-by: API Team <api-team@thousandeyes.com>
508 lines
26 KiB
Python
508 lines
26 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 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"""
|
|
|
|
|
|
|
|
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"""
|
|
|
|
|
|
|
|
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()
|