[GitHub Bot] Generated python SDK (#193)
Some checks failed
Python CI / build (push) Has been cancelled

Co-authored-by: API Team <api-team@thousandeyes.com>
This commit is contained in:
api-team-automation[bot] 2026-09-08 13:15:25 +01:00 committed by GitHub
parent f9d21e46b5
commit d4b7ca82b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
389 changed files with 22066 additions and 2489 deletions

View File

@ -12,7 +12,7 @@ This API provides the following operations to manage your organization:
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 7.0.103
- API version: 7.0.104
- Generator version: 7.6.0
- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator

View File

@ -41,6 +41,7 @@ class TestAccountGroupsApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.administrative.models.AccountGroupRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"isCurrentAccountGroup" : true,
@ -101,14 +102,17 @@ class TestAccountGroupsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.CreatedAccountGroup.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_delete_account_group_models_validation(self) -> None:
"""Test case for delete_account_group request and response models"""
def test_get_account_group_models_validation(self) -> None:
"""Test case for get_account_group request and response models"""
response_body_json = """
{
"isCurrentAccountGroup" : true,
@ -477,10 +481,12 @@ class TestAccountGroupsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.AccountGroupDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_get_account_groups_models_validation(self) -> None:
"""Test case for get_account_groups request and response models"""
response_body_json = """
{
"_links" : {
@ -515,6 +521,7 @@ class TestAccountGroupsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.AccountGroups.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_update_account_group_models_validation(self) -> None:
"""Test case for update_account_group request and response models"""
@ -529,6 +536,7 @@ class TestAccountGroupsApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.administrative.models.AccountGroupRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"isCurrentAccountGroup" : true,
@ -897,6 +905,7 @@ class TestAccountGroupsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.AccountGroupDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -31,6 +31,7 @@ class TestPermissionsApi(unittest.TestCase):
def test_get_permissions_models_validation(self) -> None:
"""Test case for get_permissions request and response models"""
response_body_json = """
{
"_links" : {
@ -61,6 +62,7 @@ class TestPermissionsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.Permissions.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -41,6 +41,7 @@ class TestRolesApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.administrative.models.RoleRequestBody.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"_links" : {
@ -74,14 +75,17 @@ class TestRolesApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.RoleDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_delete_role_models_validation(self) -> None:
"""Test case for delete_role request and response models"""
def test_get_role_models_validation(self) -> None:
"""Test case for get_role request and response models"""
response_body_json = """
{
"_links" : {
@ -115,10 +119,12 @@ class TestRolesApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.RoleDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_get_roles_models_validation(self) -> None:
"""Test case for get_roles request and response models"""
response_body_json = """
{
"_links" : {
@ -149,6 +155,7 @@ class TestRolesApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.Roles.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_update_role_models_validation(self) -> None:
"""Test case for update_role request and response models"""
@ -163,6 +170,7 @@ class TestRolesApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.administrative.models.RoleRequestBody.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"_links" : {
@ -196,6 +204,7 @@ class TestRolesApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.RoleDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -31,6 +31,7 @@ class TestUserEventsApi(unittest.TestCase):
def test_get_user_events_models_validation(self) -> None:
"""Test case for get_user_events request and response models"""
response_body_json = """
{
"endDate" : "2022-07-18T22:00:54Z",
@ -96,6 +97,7 @@ class TestUserEventsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.AuditUserEvents.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -50,6 +50,7 @@ class TestUsersApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.administrative.models.UserRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"loginAccountGroup" : {
@ -121,14 +122,17 @@ class TestUsersApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.CreatedUser.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_delete_user_models_validation(self) -> None:
"""Test case for delete_user request and response models"""
def test_get_current_user_models_validation(self) -> None:
"""Test case for get_current_user request and response models"""
response_body_json = """
{
"loginAccountGroup" : {
@ -201,10 +205,12 @@ class TestUsersApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.UserDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_get_user_models_validation(self) -> None:
"""Test case for get_user request and response models"""
response_body_json = """
{
"loginAccountGroup" : {
@ -277,10 +283,12 @@ class TestUsersApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.UserDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_get_users_models_validation(self) -> None:
"""Test case for get_users request and response models"""
response_body_json = """
{
"_links" : {
@ -321,6 +329,7 @@ class TestUsersApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.Users.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_update_user_models_validation(self) -> None:
"""Test case for update_user request and response models"""
@ -344,6 +353,7 @@ class TestUsersApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.administrative.models.UserRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"loginAccountGroup" : {
@ -416,6 +426,7 @@ class TestUsersApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.administrative.models.UserDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -5,7 +5,7 @@ Manage Cloud and Enterprise Agents available to your account in ThousandEyes.
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 7.0.103
- API version: 7.0.104
- Generator version: 7.6.0
- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator

View File

@ -226,8 +226,10 @@ with thousandeyes_sdk.core.ApiClient(configuration) as 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)
expand = ["cluster-member"] # List[AgentListExpand] | Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query. (optional)
agent_types = ["enterprise"] # List[CloudEnterpriseAgentType] | Specifies the type of agent to request. (optional)
labels = ['[\"myCustomLabeledAgent\"]'] # List[str] | Specifies the labels of the agents to request. (optional)
tag_keys = ['tag_keys_example'] # List[str] | Specifies which tag keys to request from the agents. (optional)
labels = ["myCustomLabeledAgent"] # List[str] | Specifies the labels of the agents to request. (optional)
tag_keys = [
'myCustomTagKeyForAgent'
] # List[str] | Specifies which tag keys to request from the agents. (optional)
try:
# List Cloud and Enterprise Agents

View File

@ -31,6 +31,7 @@ class TestAgentProxiesApi(unittest.TestCase):
def test_get_agents_proxies_models_validation(self) -> None:
"""Test case for get_agents_proxies request and response models"""
response_body_json = """
{
"_links" : {
@ -75,6 +76,7 @@ class TestAgentProxiesApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.AgentProxies.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -31,6 +31,7 @@ class TestCloudAndEnterpriseAgentNotificationRulesApi(unittest.TestCase):
def test_get_agents_notification_rule_models_validation(self) -> None:
"""Test case for get_agents_notification_rule request and response models"""
response_body_json = """
{
"isDefault" : false,
@ -142,10 +143,12 @@ class TestCloudAndEnterpriseAgentNotificationRulesApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.NotificationRuleDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_get_agents_notification_rules_models_validation(self) -> None:
"""Test case for get_agents_notification_rules request and response models"""
response_body_json = """
{
"agentAlertRules" : [ {
@ -178,6 +181,7 @@ class TestCloudAndEnterpriseAgentNotificationRulesApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.ListNotificationRulesResponse.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -31,10 +31,12 @@ class TestCloudAndEnterpriseAgentsApi(unittest.TestCase):
def test_delete_agent_models_validation(self) -> None:
"""Test case for delete_agent request and response models"""
def test_get_agent_models_validation(self) -> None:
"""Test case for get_agent request and response models"""
response_body_json = """
{
"agentId" : "281474976710706",
@ -153,10 +155,12 @@ class TestCloudAndEnterpriseAgentsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.AgentDetails.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_get_agents_models_validation(self) -> None:
"""Test case for get_agents request and response models"""
response_body_json = """
{
"_links" : {
@ -219,6 +223,7 @@ class TestCloudAndEnterpriseAgentsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.CloudEnterpriseAgents.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_update_agent_models_validation(self) -> None:
"""Test case for update_agent request and response models"""
@ -239,6 +244,7 @@ class TestCloudAndEnterpriseAgentsApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.agents.models.AgentRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"agentId" : "281474976710706",
@ -357,6 +363,7 @@ class TestCloudAndEnterpriseAgentsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.AgentDetails.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -536,8 +536,10 @@ class TestCloudAndEnterpriseAgentsApiIntegration(IntegrationTestBase):
aid = '1234'
expand = ["cluster-member"]
agent_types = ["enterprise"]
labels = ['[\"myCustomLabeledAgent\"]']
tag_keys = ['tag_keys_example']
labels = ["myCustomLabeledAgent"]
tag_keys = [
'myCustomTagKeyForAgent'
]
response_body_json = """
{
"_links" : {
@ -620,8 +622,10 @@ class TestCloudAndEnterpriseAgentsApiIntegration(IntegrationTestBase):
aid = '1234'
expand = ["cluster-member"]
agent_types = ["enterprise"]
labels = ['[\"myCustomLabeledAgent\"]']
tag_keys = ['tag_keys_example']
labels = ["myCustomLabeledAgent"]
tag_keys = [
'myCustomTagKeyForAgent'
]
error_body_json = """
{
"error_description" : "Invalid access token",
@ -654,8 +658,10 @@ class TestCloudAndEnterpriseAgentsApiIntegration(IntegrationTestBase):
aid = '1234'
expand = ["cluster-member"]
agent_types = ["enterprise"]
labels = ['[\"myCustomLabeledAgent\"]']
tag_keys = ['tag_keys_example']
labels = ["myCustomLabeledAgent"]
tag_keys = [
'myCustomTagKeyForAgent'
]
error_body_json = """
{
"instance" : "instance",
@ -691,8 +697,10 @@ class TestCloudAndEnterpriseAgentsApiIntegration(IntegrationTestBase):
aid = '1234'
expand = ["cluster-member"]
agent_types = ["enterprise"]
labels = ['[\"myCustomLabeledAgent\"]']
tag_keys = ['tag_keys_example']
labels = ["myCustomLabeledAgent"]
tag_keys = [
'myCustomTagKeyForAgent'
]
error_body_json = """
{
"instance" : "instance",
@ -728,8 +736,10 @@ class TestCloudAndEnterpriseAgentsApiIntegration(IntegrationTestBase):
aid = '1234'
expand = ["cluster-member"]
agent_types = ["enterprise"]
labels = ['[\"myCustomLabeledAgent\"]']
tag_keys = ['tag_keys_example']
labels = ["myCustomLabeledAgent"]
tag_keys = [
'myCustomTagKeyForAgent'
]
error_body_json = """
{
"instance" : "instance",
@ -765,8 +775,10 @@ class TestCloudAndEnterpriseAgentsApiIntegration(IntegrationTestBase):
aid = '1234'
expand = ["cluster-member"]
agent_types = ["enterprise"]
labels = ['[\"myCustomLabeledAgent\"]']
tag_keys = ['tag_keys_example']
labels = ["myCustomLabeledAgent"]
tag_keys = [
'myCustomTagKeyForAgent'
]
error_body_json = """
{
"instance" : "instance",
@ -802,8 +814,10 @@ class TestCloudAndEnterpriseAgentsApiIntegration(IntegrationTestBase):
aid = '1234'
expand = ["cluster-member"]
agent_types = ["enterprise"]
labels = ['[\"myCustomLabeledAgent\"]']
tag_keys = ['tag_keys_example']
labels = ["myCustomLabeledAgent"]
tag_keys = [
'myCustomTagKeyForAgent'
]
error_body_json = """
{
"instance" : "instance",

View File

@ -40,6 +40,7 @@ class TestEnterpriseAgentClusterApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.agents.models.AgentClusterAssignRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"agentId" : "281474976710706",
@ -158,6 +159,7 @@ class TestEnterpriseAgentClusterApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.AgentDetails.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_unassign_agent_from_cluster_models_validation(self) -> None:
"""Test case for unassign_agent_from_cluster request and response models"""
@ -171,6 +173,7 @@ class TestEnterpriseAgentClusterApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.agents.models.AgentClusterUnassignRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"_links" : {
@ -233,6 +236,7 @@ class TestEnterpriseAgentClusterApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.CloudEnterpriseAgents.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -31,6 +31,7 @@ class TestLocalProblemsApi(unittest.TestCase):
def test_get_agents_local_problems_models_validation(self) -> None:
"""Test case for get_agents_local_problems request and response models"""
response_body_json = """
{
"endDate" : "2022-07-18T22:00:54Z",
@ -75,6 +76,7 @@ class TestLocalProblemsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.LocalProblemAgentResults.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -40,6 +40,7 @@ class TestTestsAssignmentOnAgentsApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.agents.models.AgentTestsAssignRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"agentId" : "281474976710706",
@ -158,6 +159,7 @@ class TestTestsAssignmentOnAgentsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.AgentDetails.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_overwrite_tests_models_validation(self) -> None:
"""Test case for overwrite_tests request and response models"""
@ -171,6 +173,7 @@ class TestTestsAssignmentOnAgentsApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.agents.models.AgentTestsAssignRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"agentId" : "281474976710706",
@ -289,6 +292,7 @@ class TestTestsAssignmentOnAgentsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.AgentDetails.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_unassign_tests_models_validation(self) -> None:
"""Test case for unassign_tests request and response models"""
@ -302,6 +306,7 @@ class TestTestsAssignmentOnAgentsApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.agents.models.AgentTestsAssignRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"agentId" : "281474976710706",
@ -420,6 +425,7 @@ class TestTestsAssignmentOnAgentsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.agents.models.AgentDetails.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -14,7 +14,7 @@ For more information about the alerts, see [Alerts](https://docs.thousandeyes.co
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 7.0.103
- API version: 7.0.104
- Generator version: 7.6.0
- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator

View File

@ -95,6 +95,7 @@ class TestAlertRulesApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.alerts.models.RuleDetailUpdate.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"severity" : "major",
@ -170,14 +171,17 @@ class TestAlertRulesApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.alerts.models.Rule.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_delete_alert_rule_models_validation(self) -> None:
"""Test case for delete_alert_rule request and response models"""
def test_get_alert_rule_models_validation(self) -> None:
"""Test case for get_alert_rule request and response models"""
response_body_json = """
{
"severity" : "major",
@ -316,10 +320,12 @@ class TestAlertRulesApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.alerts.models.RuleDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_get_alerts_rules_models_validation(self) -> None:
"""Test case for get_alerts_rules request and response models"""
response_body_json = """
{
"_links" : {
@ -382,6 +388,7 @@ class TestAlertRulesApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.alerts.models.Rules.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_update_alert_rule_models_validation(self) -> None:
"""Test case for update_alert_rule request and response models"""
@ -450,6 +457,7 @@ class TestAlertRulesApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.alerts.models.RuleDetailUpdate.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"severity" : "major",
@ -525,6 +533,7 @@ class TestAlertRulesApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.alerts.models.Rule.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -57,6 +57,7 @@ class TestAlertSuppressionWindowsApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.alerts.models.AlertSuppressionWindowRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"duration" : 0,
@ -156,14 +157,17 @@ class TestAlertSuppressionWindowsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.alerts.models.AlertSuppressionWindowDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_delete_alert_suppression_window_models_validation(self) -> None:
"""Test case for delete_alert_suppression_window request and response models"""
def test_get_alert_suppression_window_models_validation(self) -> None:
"""Test case for get_alert_suppression_window request and response models"""
response_body_json = """
{
"duration" : 0,
@ -263,10 +267,12 @@ class TestAlertSuppressionWindowsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.alerts.models.AlertSuppressionWindowDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_get_alert_suppression_windows_models_validation(self) -> None:
"""Test case for get_alert_suppression_windows request and response models"""
response_body_json = """
{
"_links" : {
@ -347,6 +353,7 @@ class TestAlertSuppressionWindowsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.alerts.models.AlertSuppressionWindows.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_update_alert_suppression_window_models_validation(self) -> None:
"""Test case for update_alert_suppression_window request and response models"""
@ -377,6 +384,7 @@ class TestAlertSuppressionWindowsApi(unittest.TestCase):
request_from_json = thousandeyes_sdk.alerts.models.AlertSuppressionWindowRequest.from_json(request_body_json)
assert_constructed_model_matches_example_json(request_from_json, request_loaded_json)
response_body_json = """
{
"duration" : 0,
@ -476,6 +484,7 @@ class TestAlertSuppressionWindowsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.alerts.models.AlertSuppressionWindowDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -31,6 +31,7 @@ class TestAlertsApi(unittest.TestCase):
def test_get_alert_models_validation(self) -> None:
"""Test case for get_alert request and response models"""
response_body_json = """
{
"severity" : "major",
@ -124,10 +125,12 @@ class TestAlertsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.alerts.models.AlertDetail.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
def test_get_alerts_models_validation(self) -> None:
"""Test case for get_alerts request and response models"""
response_body_json = """
{
"alerts" : [ {
@ -304,6 +307,7 @@ class TestAlertsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.alerts.models.Alerts.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -10,7 +10,7 @@ For more information about monitors, see [Inside-Out BGP Visibility](https://doc
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 7.0.103
- API version: 7.0.104
- Generator version: 7.6.0
- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator

View File

@ -31,6 +31,7 @@ class TestBGPMonitorsApi(unittest.TestCase):
def test_get_bgp_monitors_models_validation(self) -> None:
"""Test case for get_bgp_monitors request and response models"""
response_body_json = """
{
"_links" : {
@ -65,6 +66,7 @@ class TestBGPMonitorsApi(unittest.TestCase):
response_loaded_json = json.loads(response_body_json)
response_from_json = thousandeyes_sdk.bgp_monitors.models.Monitors.from_json(response_body_json)
assert_constructed_model_matches_example_json(response_from_json, response_loaded_json)
if __name__ == '__main__':

View File

@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

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

View File

@ -0,0 +1 @@
7.6.0

View File

@ -0,0 +1 @@
include docs/*

View File

@ -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.104
- 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)
prefixes = ["192.0.2.0/24"] # List[str] | Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes. (optional)
origin_ases = [64512] # List[int] | Origin AS filters. Repeat the parameter to filter by multiple ASNs. (optional)
as_paths = ["64512 64513"] # List[str] | AS path filters, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths. (optional)
rpki_statuses = [
'Valid'
] # List[BgpRpkiStatus] | RPKI status filters. (optional)
update_type = [
'announcement'
] # List[BgpUpdateType] | BGP update type filters. (optional)
monitor_ids = ["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, prefixes=prefixes, origin_ases=origin_ases, as_paths=as_paths, rpki_statuses=rpki_statuses, update_type=update_type, monitor_ids=monitor_ids, 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)
<a id="documentation-for-authorization"></a>
## Documentation For Authorization
Authentication schemes defined for the API:
<a id="BearerAuth"></a>
### BearerAuth
- **Type**: Bearer authentication
## Author
<a href="mailto:api-team@thousandeyes.com">ThousandEyes API Team </a>

View File

@ -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, prefixes=prefixes, origin_ases=origin_ases, as_paths=as_paths, rpki_statuses=rpki_statuses, update_type=update_type, monitor_ids=monitor_ids, communities=communities)
List BGP updates
Retrieves a paginated list of BGP updates for prefixes tracked by the account group. When the `prefixes` filter is 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)
prefixes = ["192.0.2.0/24"] # List[str] | Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes. (optional)
origin_ases = [64512] # List[int] | Origin AS filters. Repeat the parameter to filter by multiple ASNs. (optional)
as_paths = ["64512 64513"] # List[str] | AS path filters, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths. (optional)
rpki_statuses = [
'Valid'
] # List[BgpRpkiStatus] | RPKI status filters. (optional)
update_type = [
'announcement'
] # List[BgpUpdateType] | BGP update type filters. (optional)
monitor_ids = ["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, prefixes=prefixes, origin_ases=origin_ases, as_paths=as_paths, rpki_statuses=rpki_statuses, update_type=update_type, monitor_ids=monitor_ids, 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 &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
**max** | **int**| Maximum number of BGP updates to return. | [optional] [default to 20]
**cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use &#x60;next&#x60; value from &#x60;_links&#x60; instead of this parameter. | [optional]
**expand** | [**List[BgpDataExpandOption]**](BgpDataExpandOption.md)| Optional expansions. Pass &#x60;expand&#x3D;monitor&#x60; to replace monitor IDs with full BGP monitor objects. | [optional]
**start_date** | **datetime**| Use with the &#x60;endDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. | [optional]
**end_date** | **datetime**| Defaults to current time the request is made. Use with the &#x60;startDate&#x60; parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can&#39;t be used with &#x60;window&#x60;. | [optional]
**prefixes** | [**List[str]**](str.md)| Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes. | [optional]
**origin_ases** | [**List[int]**](int.md)| Origin AS filters. Repeat the parameter to filter by multiple ASNs. | [optional]
**as_paths** | [**List[str]**](str.md)| AS path filters, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths. | [optional]
**rpki_statuses** | [**List[BgpRpkiStatus]**](BgpRpkiStatus.md)| RPKI status filters. | [optional]
**update_type** | [**List[BgpUpdateType]**](BgpUpdateType.md)| BGP update type filters. | [optional]
**monitor_ids** | [**List[str]**](str.md)| BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get &#x60;monitorId&#x60; from the &#x60;/monitors&#x60; 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)

View File

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

View File

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

View File

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

View File

@ -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 &#x60;expand&#x3D;monitor&#x60; is requested. | [optional]
**monitor** | [**BgpMonitor**](BgpMonitor.md) | BGP monitor that observed the update. Returned when &#x60;expand&#x3D;monitor&#x60; is requested and replaces &#x60;monitorId&#x60;. | [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)

View File

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

View File

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

View File

@ -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 \&quot;about:blank\&quot;. | [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)

View File

@ -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&#39;s \&quot;href\&quot; 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)

View File

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

View File

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

View File

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

View File

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

View File

@ -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 \&quot;about:blank\&quot;. | [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)

View File

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

View File

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

View File

@ -0,0 +1,2 @@
[flake8]
max-line-length=99

View File

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

View File

@ -0,0 +1,5 @@
# flake8: noqa
# import apis into api package
from thousandeyes_sdk.bgp_updates.api.bgp_updates_api import BGPUpdatesApi

View File

@ -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,
prefixes: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes.")] = None,
origin_ases: Annotated[Optional[Annotated[List[StrictInt], Field(max_length=1000)]], Field(description="Origin AS filters. Repeat the parameter to filter by multiple ASNs.")] = None,
as_paths: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="AS path filters, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths.")] = None,
rpki_statuses: 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_ids: 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 the `prefixes` filter is 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 prefixes: Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes.
:type prefixes: List[str]
:param origin_ases: Origin AS filters. Repeat the parameter to filter by multiple ASNs.
:type origin_ases: List[int]
:param as_paths: AS path filters, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths.
:type as_paths: List[str]
:param rpki_statuses: RPKI status filters.
:type rpki_statuses: List[BgpRpkiStatus]
:param update_type: BGP update type filters.
:type update_type: List[BgpUpdateType]
:param monitor_ids: BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint.
:type monitor_ids: 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,
prefixes=prefixes,
origin_ases=origin_ases,
as_paths=as_paths,
rpki_statuses=rpki_statuses,
update_type=update_type,
monitor_ids=monitor_ids,
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,
prefixes: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes.")] = None,
origin_ases: Annotated[Optional[Annotated[List[StrictInt], Field(max_length=1000)]], Field(description="Origin AS filters. Repeat the parameter to filter by multiple ASNs.")] = None,
as_paths: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="AS path filters, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths.")] = None,
rpki_statuses: 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_ids: 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 the `prefixes` filter is 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 prefixes: Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes.
:type prefixes: List[str]
:param origin_ases: Origin AS filters. Repeat the parameter to filter by multiple ASNs.
:type origin_ases: List[int]
:param as_paths: AS path filters, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths.
:type as_paths: List[str]
:param rpki_statuses: RPKI status filters.
:type rpki_statuses: List[BgpRpkiStatus]
:param update_type: BGP update type filters.
:type update_type: List[BgpUpdateType]
:param monitor_ids: BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint.
:type monitor_ids: 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,
prefixes=prefixes,
origin_ases=origin_ases,
as_paths=as_paths,
rpki_statuses=rpki_statuses,
update_type=update_type,
monitor_ids=monitor_ids,
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,
prefixes: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes.")] = None,
origin_ases: Annotated[Optional[Annotated[List[StrictInt], Field(max_length=1000)]], Field(description="Origin AS filters. Repeat the parameter to filter by multiple ASNs.")] = None,
as_paths: Annotated[Optional[Annotated[List[StrictStr], Field(max_length=1000)]], Field(description="AS path filters, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths.")] = None,
rpki_statuses: 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_ids: 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 the `prefixes` filter is 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 prefixes: Prefix CIDR filters. Repeat the parameter to filter by multiple prefixes.
:type prefixes: List[str]
:param origin_ases: Origin AS filters. Repeat the parameter to filter by multiple ASNs.
:type origin_ases: List[int]
:param as_paths: AS path filters, expressed as a space-separated list of ASNs. Repeat the parameter to filter by multiple AS paths.
:type as_paths: List[str]
:param rpki_statuses: RPKI status filters.
:type rpki_statuses: List[BgpRpkiStatus]
:param update_type: BGP update type filters.
:type update_type: List[BgpUpdateType]
:param monitor_ids: BGP monitor ID filters. Repeat the parameter to filter by multiple monitors. Get `monitorId` from the `/monitors` endpoint.
:type monitor_ids: 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,
prefixes=prefixes,
origin_ases=origin_ases,
as_paths=as_paths,
rpki_statuses=rpki_statuses,
update_type=update_type,
monitor_ids=monitor_ids,
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,
prefixes,
origin_ases,
as_paths,
rpki_statuses,
update_type,
monitor_ids,
communities,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
'expand': 'csv',
'prefixes': 'multi',
'originAses': 'multi',
'asPaths': 'multi',
'rpkiStatuses': 'multi',
'updateType': 'multi',
'monitorIds': '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 prefixes is not None:
_query_params.append(('prefixes', prefixes))
if origin_ases is not None:
_query_params.append(('originAses', origin_ases))
if as_paths is not None:
_query_params.append(('asPaths', as_paths))
if rpki_statuses is not None:
_query_params.append(('rpkiStatuses', rpki_statuses))
if update_type is not None:
_query_params.append(('updateType', update_type))
if monitor_ids is not None:
_query_params.append(('monitorIds', monitor_ids))
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
)

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,115 @@
# 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]] = ["prefix", "originAs", "asPath", "communities", "rpkiStatus", "updateType", "monitorId", "monitor", "timestamp"]
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,
)
# override the default output from pydantic by calling `to_dict()` of monitor
if self.monitor:
_dict['monitor'] = self.monitor.to_dict()
# set to None if origin_as (nullable) is None
# and model_fields_set contains the field
if self.origin_as is None and "origin_as" in self.model_fields_set:
_dict['originAs'] = None
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({
"prefix": obj.get("prefix"),
"originAs": obj.get("originAs"),
"asPath": obj.get("asPath"),
"communities": obj.get("communities"),
"rpkiStatus": obj.get("rpkiStatus"),
"updateType": obj.get("updateType"),
"monitorId": obj.get("monitorId"),
"monitor": BgpMonitor.from_dict(obj["monitor"]) if obj.get("monitor") is not None else None,
"timestamp": obj.get("timestamp")
})
return _obj

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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",
),
},
),
}

View File

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

View File

@ -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'
prefixes = ["192.0.2.0/24"]
origin_ases = [64512]
as_paths = ["64512 64513"]
rpki_statuses = [
'Valid'
]
update_type = [
'announcement'
]
monitor_ids = ["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,
prefixes=prefixes,
origin_ases=origin_ases,
as_paths=as_paths,
rpki_statuses=rpki_statuses,
update_type=update_type,
monitor_ids=monitor_ids,
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'
prefixes = ["192.0.2.0/24"]
origin_ases = [64512]
as_paths = ["64512 64513"]
rpki_statuses = [
'Valid'
]
update_type = [
'announcement'
]
monitor_ids = ["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,
prefixes=prefixes,
origin_ases=origin_ases,
as_paths=as_paths,
rpki_statuses=rpki_statuses,
update_type=update_type,
monitor_ids=monitor_ids,
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'
prefixes = ["192.0.2.0/24"]
origin_ases = [64512]
as_paths = ["64512 64513"]
rpki_statuses = [
'Valid'
]
update_type = [
'announcement'
]
monitor_ids = ["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,
prefixes=prefixes,
origin_ases=origin_ases,
as_paths=as_paths,
rpki_statuses=rpki_statuses,
update_type=update_type,
monitor_ids=monitor_ids,
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'
prefixes = ["192.0.2.0/24"]
origin_ases = [64512]
as_paths = ["64512 64513"]
rpki_statuses = [
'Valid'
]
update_type = [
'announcement'
]
monitor_ids = ["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,
prefixes=prefixes,
origin_ases=origin_ases,
as_paths=as_paths,
rpki_statuses=rpki_statuses,
update_type=update_type,
monitor_ids=monitor_ids,
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'
prefixes = ["192.0.2.0/24"]
origin_ases = [64512]
as_paths = ["64512 64513"]
rpki_statuses = [
'Valid'
]
update_type = [
'announcement'
]
monitor_ids = ["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,
prefixes=prefixes,
origin_ases=origin_ases,
as_paths=as_paths,
rpki_statuses=rpki_statuses,
update_type=update_type,
monitor_ids=monitor_ids,
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'
prefixes = ["192.0.2.0/24"]
origin_ases = [64512]
as_paths = ["64512 64513"]
rpki_statuses = [
'Valid'
]
update_type = [
'announcement'
]
monitor_ids = ["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,
prefixes=prefixes,
origin_ases=origin_ases,
as_paths=as_paths,
rpki_statuses=rpki_statuses,
update_type=update_type,
monitor_ids=monitor_ids,
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'
prefixes = ["192.0.2.0/24"]
origin_ases = [64512]
as_paths = ["64512 64513"]
rpki_statuses = [
'Valid'
]
update_type = [
'announcement'
]
monitor_ids = ["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,
prefixes=prefixes,
origin_ases=origin_ases,
as_paths=as_paths,
rpki_statuses=rpki_statuses,
update_type=update_type,
monitor_ids=monitor_ids,
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'
prefixes = ["192.0.2.0/24"]
origin_ases = [64512]
as_paths = ["64512 64513"]
rpki_statuses = [
'Valid'
]
update_type = [
'announcement'
]
monitor_ids = ["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,
prefixes=prefixes,
origin_ases=origin_ases,
as_paths=as_paths,
rpki_statuses=rpki_statuses,
update_type=update_type,
monitor_ids=monitor_ids,
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()

View File

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

View File

@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

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

View File

@ -0,0 +1 @@
include docs/*

View File

@ -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.104
- 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)
<a id="documentation-for-authorization"></a>
## Documentation For Authorization
Authentication schemes defined for the API:
<a id="BearerAuth"></a>
### BearerAuth
- **Type**: Bearer authentication
## Author
<a href="mailto:api-team@thousandeyes.com">ThousandEyes API Team </a>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
### Return type
[**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 &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
### Return type
[**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 &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
### Return type
[**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 &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
### Return type
[**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)

File diff suppressed because it is too large Load Diff

View File

@ -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 \&quot;about:blank\&quot;. | [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)

View File

@ -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&#39;s \&quot;href\&quot; 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)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 \&quot;about:blank\&quot;. | [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)

View File

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

View File

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

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