diff --git a/thousandeyes-sdk-administrative/.openapi-generator/FILES b/thousandeyes-sdk-administrative/.openapi-generator/FILES index c473353c..4454791a 100644 --- a/thousandeyes-sdk-administrative/.openapi-generator/FILES +++ b/thousandeyes-sdk-administrative/.openapi-generator/FILES @@ -39,6 +39,11 @@ docs/Roles.md docs/RolesApi.md docs/SelfLinks.md docs/SimpleAgent.md +docs/SimpleTest.md +docs/TestInterval.md +docs/TestLinks.md +docs/TestSelfLink.md +docs/TestType.md docs/UnauthorizedError.md docs/User.md docs/UserAccountGroup.md @@ -96,6 +101,11 @@ src/thousandeyes_sdk/administrative/models/role_request_body.py src/thousandeyes_sdk/administrative/models/roles.py src/thousandeyes_sdk/administrative/models/self_links.py src/thousandeyes_sdk/administrative/models/simple_agent.py +src/thousandeyes_sdk/administrative/models/simple_test.py +src/thousandeyes_sdk/administrative/models/test_interval.py +src/thousandeyes_sdk/administrative/models/test_links.py +src/thousandeyes_sdk/administrative/models/test_self_link.py +src/thousandeyes_sdk/administrative/models/test_type.py src/thousandeyes_sdk/administrative/models/unauthorized_error.py src/thousandeyes_sdk/administrative/models/user.py src/thousandeyes_sdk/administrative/models/user_account_group.py diff --git a/thousandeyes-sdk-administrative/README.md b/thousandeyes-sdk-administrative/README.md index f23b3152..102c9fa8 100644 --- a/thousandeyes-sdk-administrative/README.md +++ b/thousandeyes-sdk-administrative/README.md @@ -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.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -161,6 +161,11 @@ Class | Method | HTTP request | Description - [Roles](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/Roles.md) - [SelfLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/SelfLinks.md) - [SimpleAgent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/SimpleAgent.md) + - [SimpleTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/SimpleTest.md) + - [TestInterval](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/TestInterval.md) + - [TestLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/TestLinks.md) + - [TestSelfLink](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/TestSelfLink.md) + - [TestType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/TestType.md) - [UnauthorizedError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/UnauthorizedError.md) - [User](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/User.md) - [UserAccountGroup](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-administrative/docs/UserAccountGroup.md) diff --git a/thousandeyes-sdk-administrative/docs/EnterpriseAgent.md b/thousandeyes-sdk-administrative/docs/EnterpriseAgent.md index 3eb32c44..88b973a3 100644 --- a/thousandeyes-sdk-administrative/docs/EnterpriseAgent.md +++ b/thousandeyes-sdk-administrative/docs/EnterpriseAgent.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] **prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly] **verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**test_ids** | **List[int]** | List of test IDs assigned to the agent. | [optional] [readonly] +**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly] **utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] **account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional] @@ -28,7 +30,7 @@ Name | Type | Description | Notes **created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly] **target_for_tests** | **str** | Test target IP address. | [optional] **local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional] -**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] +**interface_ip_mapping** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-administrative/docs/EnterpriseAgentData.md b/thousandeyes-sdk-administrative/docs/EnterpriseAgentData.md index 6ca1da5f..ec222584 100644 --- a/thousandeyes-sdk-administrative/docs/EnterpriseAgentData.md +++ b/thousandeyes-sdk-administrative/docs/EnterpriseAgentData.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**test_ids** | **List[int]** | List of test IDs assigned to the agent. | [optional] [readonly] +**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly] **utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] **account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional] @@ -17,7 +19,7 @@ Name | Type | Description | Notes **created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly] **target_for_tests** | **str** | Test target IP address. | [optional] **local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional] -**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] +**interface_ip_mapping** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-administrative/docs/SimpleTest.md b/thousandeyes-sdk-administrative/docs/SimpleTest.md new file mode 100644 index 00000000..bb573947 --- /dev/null +++ b/thousandeyes-sdk-administrative/docs/SimpleTest.md @@ -0,0 +1,43 @@ +# SimpleTest + +Each test includes additional fields depending on its `type`. Refer `/tests/{type}` endpoint to know the set of fields returned by a given `type`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**interval** | [**TestInterval**](TestInterval.md) | | [optional] +**alerts_enabled** | **bool** | Indicates if alerts are enabled. | [optional] +**enabled** | **bool** | Test is enabled. | [optional] [default to True] +**created_by** | **str** | User that created the test. | [optional] [readonly] +**created_date** | **datetime** | UTC created date (ISO date-time format). | [optional] [readonly] +**description** | **str** | A description of the test. | [optional] +**live_share** | **bool** | Indicates if the test is shared with the account group. | [optional] [readonly] +**modified_by** | **str** | User that modified the test. | [optional] [readonly] +**modified_date** | **datetime** | UTC last modification date (ISO date-time format). | [optional] [readonly] +**saved_event** | **bool** | Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. | [optional] [readonly] +**test_id** | **str** | Each test is assigned an unique ID; this is used to access test information and results from other endpoints. | [optional] [readonly] +**test_name** | **str** | The name of the test. Test name must be unique. | [optional] +**type** | [**TestType**](TestType.md) | | [optional] +**links** | [**TestLinks**](TestLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.administrative.models.simple_test import SimpleTest + +# TODO update the JSON string below +json = "{}" +# create an instance of SimpleTest from a JSON string +simple_test_instance = SimpleTest.from_json(json) +# print the JSON string representation of the object +print(SimpleTest.to_json()) + +# convert the object into a dict +simple_test_dict = simple_test_instance.to_dict() +# create an instance of SimpleTest from a dict +simple_test_from_dict = SimpleTest.from_dict(simple_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-administrative/docs/TestInterval.md b/thousandeyes-sdk-administrative/docs/TestInterval.md new file mode 100644 index 00000000..6f14970f --- /dev/null +++ b/thousandeyes-sdk-administrative/docs/TestInterval.md @@ -0,0 +1,12 @@ +# TestInterval + +Interval between test runs in seconds. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-administrative/docs/TestLinks.md b/thousandeyes-sdk-administrative/docs/TestLinks.md new file mode 100644 index 00000000..397473e3 --- /dev/null +++ b/thousandeyes-sdk-administrative/docs/TestLinks.md @@ -0,0 +1,31 @@ +# TestLinks + +A list of links that can be accessed to get more information + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**TestSelfLink**](TestSelfLink.md) | | [optional] +**test_results** | [**List[Link]**](Link.md) | Reference to the test results. | [optional] + +## Example + +```python +from thousandeyes_sdk.administrative.models.test_links import TestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of TestLinks from a JSON string +test_links_instance = TestLinks.from_json(json) +# print the JSON string representation of the object +print(TestLinks.to_json()) + +# convert the object into a dict +test_links_dict = test_links_instance.to_dict() +# create an instance of TestLinks from a dict +test_links_from_dict = TestLinks.from_dict(test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-administrative/docs/TestSelfLink.md b/thousandeyes-sdk-administrative/docs/TestSelfLink.md new file mode 100644 index 00000000..1d3608d5 --- /dev/null +++ b/thousandeyes-sdk-administrative/docs/TestSelfLink.md @@ -0,0 +1,36 @@ +# TestSelfLink + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from thousandeyes_sdk.administrative.models.test_self_link import TestSelfLink + +# TODO update the JSON string below +json = "{}" +# create an instance of TestSelfLink from a JSON string +test_self_link_instance = TestSelfLink.from_json(json) +# print the JSON string representation of the object +print(TestSelfLink.to_json()) + +# convert the object into a dict +test_self_link_dict = test_self_link_instance.to_dict() +# create an instance of TestSelfLink from a dict +test_self_link_from_dict = TestSelfLink.from_dict(test_self_link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-administrative/docs/TestType.md b/thousandeyes-sdk-administrative/docs/TestType.md new file mode 100644 index 00000000..8093a739 --- /dev/null +++ b/thousandeyes-sdk-administrative/docs/TestType.md @@ -0,0 +1,12 @@ +# TestType + +This is a read only value, as test type is implicit in the test creation url. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/__init__.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/__init__.py index 5d260cb2..9ba40a83 100644 --- a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/__init__.py +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/__init__.py @@ -57,6 +57,11 @@ from thousandeyes_sdk.administrative.models.role_request_body import RoleRequest from thousandeyes_sdk.administrative.models.roles import Roles from thousandeyes_sdk.administrative.models.self_links import SelfLinks from thousandeyes_sdk.administrative.models.simple_agent import SimpleAgent +from thousandeyes_sdk.administrative.models.simple_test import SimpleTest +from thousandeyes_sdk.administrative.models.test_interval import TestInterval +from thousandeyes_sdk.administrative.models.test_links import TestLinks +from thousandeyes_sdk.administrative.models.test_self_link import TestSelfLink +from thousandeyes_sdk.administrative.models.test_type import TestType from thousandeyes_sdk.administrative.models.unauthorized_error import UnauthorizedError from thousandeyes_sdk.administrative.models.user import User from thousandeyes_sdk.administrative.models.user_account_group import UserAccountGroup diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/__init__.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/__init__.py index 98938db0..2227c608 100644 --- a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/__init__.py +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/__init__.py @@ -48,6 +48,11 @@ from thousandeyes_sdk.administrative.models.role_request_body import RoleRequest from thousandeyes_sdk.administrative.models.roles import Roles from thousandeyes_sdk.administrative.models.self_links import SelfLinks from thousandeyes_sdk.administrative.models.simple_agent import SimpleAgent +from thousandeyes_sdk.administrative.models.simple_test import SimpleTest +from thousandeyes_sdk.administrative.models.test_interval import TestInterval +from thousandeyes_sdk.administrative.models.test_links import TestLinks +from thousandeyes_sdk.administrative.models.test_self_link import TestSelfLink +from thousandeyes_sdk.administrative.models.test_type import TestType from thousandeyes_sdk.administrative.models.unauthorized_error import UnauthorizedError from thousandeyes_sdk.administrative.models.user import User from thousandeyes_sdk.administrative.models.user_account_group import UserAccountGroup diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent.py index c263f0ac..9a4db53e 100644 --- a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent.py +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent.py @@ -26,6 +26,7 @@ from thousandeyes_sdk.administrative.models.enterprise_agent_ipv6_policy import from thousandeyes_sdk.administrative.models.enterprise_agent_state import EnterpriseAgentState from thousandeyes_sdk.administrative.models.error_detail import ErrorDetail from thousandeyes_sdk.administrative.models.interface_ip_mapping import InterfaceIpMapping +from thousandeyes_sdk.administrative.models.simple_test import SimpleTest from typing import Optional, Set from typing_extensions import Self @@ -44,6 +45,8 @@ class EnterpriseAgent(BaseModel): enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.") prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.") verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates") + test_ids: Optional[List[StrictInt]] = Field(default=None, description="List of test IDs assigned to the agent.", alias="testIds") + tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers") utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).") account_groups: Optional[List[AccountGroup]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups") @@ -56,8 +59,8 @@ class EnterpriseAgent(BaseModel): created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate") target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests") local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes") - interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings") - __properties: ClassVar[List[str]] = ["agentType", "ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings"] + interface_ip_mapping: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMapping") + __properties: ClassVar[List[str]] = ["agentType", "ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "testIds", "tests", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMapping"] model_config = ConfigDict( populate_by_name=True, @@ -105,6 +108,7 @@ class EnterpriseAgent(BaseModel): * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "ip_addresses", @@ -115,13 +119,14 @@ class EnterpriseAgent(BaseModel): "country_id", "prefix", "verify_ssl_certificates", + "test_ids", "cluster_members", "utilization", "error_details", "hostname", "last_seen", "created_date", - "interface_ip_mappings", + "interface_ip_mapping", ]) _dict = self.model_dump( @@ -129,6 +134,13 @@ class EnterpriseAgent(BaseModel): exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items # override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list) _items = [] if self.cluster_members: @@ -150,13 +162,13 @@ class EnterpriseAgent(BaseModel): if _item: _items.append(_item.to_dict()) _dict['errorDetails'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list) + # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mapping (list) _items = [] - if self.interface_ip_mappings: - for _item in self.interface_ip_mappings: + if self.interface_ip_mapping: + for _item in self.interface_ip_mapping: if _item: _items.append(_item.to_dict()) - _dict['interfaceIpMappings'] = _items + _dict['interfaceIpMapping'] = _items return _dict @classmethod @@ -180,6 +192,8 @@ class EnterpriseAgent(BaseModel): "enabled": obj.get("enabled"), "prefix": obj.get("prefix"), "verifySslCertificates": obj.get("verifySslCertificates"), + "testIds": obj.get("testIds"), + "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "clusterMembers": [ClusterMember.from_dict(_item) for _item in obj["clusterMembers"]] if obj.get("clusterMembers") is not None else None, "utilization": obj.get("utilization"), "accountGroups": [AccountGroup.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None, @@ -192,7 +206,7 @@ class EnterpriseAgent(BaseModel): "createdDate": obj.get("createdDate"), "targetForTests": obj.get("targetForTests"), "localResolutionPrefixes": obj.get("localResolutionPrefixes"), - "interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMappings"]] if obj.get("interfaceIpMappings") is not None else None + "interfaceIpMapping": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMapping"]] if obj.get("interfaceIpMapping") is not None else None }) return _obj diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_data.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_data.py index 5e6689cc..61174e91 100644 --- a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_data.py +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/enterprise_agent_data.py @@ -25,6 +25,7 @@ from thousandeyes_sdk.administrative.models.enterprise_agent_ipv6_policy import from thousandeyes_sdk.administrative.models.enterprise_agent_state import EnterpriseAgentState from thousandeyes_sdk.administrative.models.error_detail import ErrorDetail from thousandeyes_sdk.administrative.models.interface_ip_mapping import InterfaceIpMapping +from thousandeyes_sdk.administrative.models.simple_test import SimpleTest from typing import Optional, Set from typing_extensions import Self @@ -32,6 +33,8 @@ class EnterpriseAgentData(BaseModel): """ EnterpriseAgentData """ # noqa: E501 + test_ids: Optional[List[StrictInt]] = Field(default=None, description="List of test IDs assigned to the agent.", alias="testIds") + tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers") utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).") account_groups: Optional[List[AccountGroup]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups") @@ -44,8 +47,8 @@ class EnterpriseAgentData(BaseModel): created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate") target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests") local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes") - interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings") - __properties: ClassVar[List[str]] = ["clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings"] + interface_ip_mapping: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMapping") + __properties: ClassVar[List[str]] = ["testIds", "tests", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMapping"] model_config = ConfigDict( populate_by_name=True, @@ -85,15 +88,17 @@ class EnterpriseAgentData(BaseModel): * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ + "test_ids", "cluster_members", "utilization", "error_details", "hostname", "last_seen", "created_date", - "interface_ip_mappings", + "interface_ip_mapping", ]) _dict = self.model_dump( @@ -101,6 +106,13 @@ class EnterpriseAgentData(BaseModel): exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items # override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list) _items = [] if self.cluster_members: @@ -122,13 +134,13 @@ class EnterpriseAgentData(BaseModel): if _item: _items.append(_item.to_dict()) _dict['errorDetails'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list) + # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mapping (list) _items = [] - if self.interface_ip_mappings: - for _item in self.interface_ip_mappings: + if self.interface_ip_mapping: + for _item in self.interface_ip_mapping: if _item: _items.append(_item.to_dict()) - _dict['interfaceIpMappings'] = _items + _dict['interfaceIpMapping'] = _items return _dict @classmethod @@ -141,6 +153,8 @@ class EnterpriseAgentData(BaseModel): return cls.model_validate(obj) _obj = cls.model_validate({ + "testIds": obj.get("testIds"), + "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "clusterMembers": [ClusterMember.from_dict(_item) for _item in obj["clusterMembers"]] if obj.get("clusterMembers") is not None else None, "utilization": obj.get("utilization"), "accountGroups": [AccountGroup.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None, @@ -153,7 +167,7 @@ class EnterpriseAgentData(BaseModel): "createdDate": obj.get("createdDate"), "targetForTests": obj.get("targetForTests"), "localResolutionPrefixes": obj.get("localResolutionPrefixes"), - "interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMappings"]] if obj.get("interfaceIpMappings") is not None else None + "interfaceIpMapping": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMapping"]] if obj.get("interfaceIpMapping") is not None else None }) return _obj diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/simple_test.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/simple_test.py new file mode 100644 index 00000000..6ec15034 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/simple_test.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Administrative API + + Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These operations can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management). + + Generated by OpenAPI Generator (https://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, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.administrative.models.test_interval import TestInterval +from thousandeyes_sdk.administrative.models.test_links import TestLinks +from thousandeyes_sdk.administrative.models.test_type import TestType +from typing import Optional, Set +from typing_extensions import Self + +class SimpleTest(BaseModel): + """ + Each test includes additional fields depending on its `type`. Refer `/tests/{type}` endpoint to know the set of fields returned by a given `type`. + """ # noqa: E501 + interval: Optional[TestInterval] = None + alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled") + enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.") + created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy") + created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate") + description: Optional[StrictStr] = Field(default=None, description="A description of the test.") + live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare") + modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy") + modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate") + saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. ", alias="savedEvent") + test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId") + test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName") + type: Optional[TestType] = None + links: Optional[TestLinks] = Field(default=None, alias="_links") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_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 SimpleTest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "created_by", + "created_date", + "live_share", + "modified_by", + "modified_date", + "saved_event", + "test_id", + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SimpleTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "interval": obj.get("interval"), + "alertsEnabled": obj.get("alertsEnabled"), + "enabled": obj.get("enabled") if obj.get("enabled") is not None else True, + "createdBy": obj.get("createdBy"), + "createdDate": obj.get("createdDate"), + "description": obj.get("description"), + "liveShare": obj.get("liveShare"), + "modifiedBy": obj.get("modifiedBy"), + "modifiedDate": obj.get("modifiedDate"), + "savedEvent": obj.get("savedEvent"), + "testId": obj.get("testId"), + "testName": obj.get("testName"), + "type": obj.get("type"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_interval.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_interval.py new file mode 100644 index 00000000..11f32d13 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_interval.py @@ -0,0 +1,46 @@ +# coding: utf-8 + +""" + Administrative API + + Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These operations can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management). + + 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 TestInterval(int, Enum): + """ + Interval between test runs in seconds. + """ + + """ + allowed enum values + """ + NUMBER_60 = 60 + NUMBER_120 = 120 + NUMBER_300 = 300 + NUMBER_600 = 600 + NUMBER_900 = 900 + NUMBER_1800 = 1800 + NUMBER_3600 = 3600 + NUMBER_11184809 = 11184809 + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestInterval from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_links.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_links.py new file mode 100644 index 00000000..87576b1b --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_links.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Administrative API + + Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These operations can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management). + + Generated by OpenAPI Generator (https://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.administrative.models.link import Link +from thousandeyes_sdk.administrative.models.test_self_link import TestSelfLink +from typing import Optional, Set +from typing_extensions import Self + +class TestLinks(BaseModel): + """ + A list of links that can be accessed to get more information + """ # noqa: E501 + var_self: Optional[TestSelfLink] = Field(default=None, alias="self") + test_results: Optional[List[Link]] = Field(default=None, description="Reference to the test results.", alias="testResults") + __properties: ClassVar[List[str]] = ["self", "testResults"] + + 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 TestLinks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of var_self + if self.var_self: + _dict['self'] = self.var_self.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in test_results (list) + _items = [] + if self.test_results: + for _item in self.test_results: + if _item: + _items.append(_item.to_dict()) + _dict['testResults'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": TestSelfLink.from_dict(obj["self"]) if obj.get("self") is not None else None, + "testResults": [Link.from_dict(_item) for _item in obj["testResults"]] if obj.get("testResults") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_self_link.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_self_link.py new file mode 100644 index 00000000..865a0178 --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_self_link.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Administrative API + + Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These operations can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management). + + Generated by OpenAPI Generator (https://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 TestSelfLink(BaseModel): + """ + TestSelfLink + """ # 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 TestSelfLink from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 TestSelfLink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "href": obj.get("href"), + "templated": obj.get("templated"), + "type": obj.get("type"), + "deprecation": obj.get("deprecation"), + "name": obj.get("name"), + "profile": obj.get("profile"), + "title": obj.get("title"), + "hreflang": obj.get("hreflang") + }) + return _obj + + diff --git a/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_type.py b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_type.py new file mode 100644 index 00000000..b70c0d6f --- /dev/null +++ b/thousandeyes-sdk-administrative/src/thousandeyes_sdk/administrative/models/test_type.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Administrative API + + Manage users, accounts, and account groups in the ThousandEyes platform using the Administrative API. This API provides the following operations to manage your organization: * `/account-groups`: Account groups are used to divide an organization into different sections. These operations can be used to create, retrieve, update and delete account groups. * `/users`: Create, retrieve, update and delete users within an organization. * `/roles`: Create, retrieve and update roles for the current user. * `/permissions`: Retrieve all assignable permissions. Used in the context of modifying roles. * `/audit-user-events`: Retrieve all activity log events. For more information about the administrative models, see [Account Management](https://docs.thousandeyes.com/product-documentation/user-management). + + 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 TestType(str, Enum): + """ + This is a read only value, as test type is implicit in the test creation url. + """ + + """ + allowed enum values + """ + API = 'api' + AGENT_MINUS_TO_MINUS_AGENT = 'agent-to-agent' + AGENT_MINUS_TO_MINUS_SERVER = 'agent-to-server' + BGP = 'bgp' + HTTP_MINUS_SERVER = 'http-server' + PAGE_MINUS_LOAD = 'page-load' + WEB_MINUS_TRANSACTIONS = 'web-transactions' + FTP_MINUS_SERVER = 'ftp-server' + DNS_MINUS_TRACE = 'dns-trace' + DNS_MINUS_SERVER = 'dns-server' + DNSSEC = 'dnssec' + SIP_MINUS_SERVER = 'sip-server' + VOICE = 'voice' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestType from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-administrative/test/test_account_groups_api.py b/thousandeyes-sdk-administrative/test/test_account_groups_api.py index ef062392..01e69e7f 100644 --- a/thousandeyes-sdk-administrative/test/test_account_groups_api.py +++ b/thousandeyes-sdk-administrative/test/test_account_groups_api.py @@ -165,16 +165,20 @@ class TestAccountGroupsApi(unittest.TestCase): "dateRegistered" : "2022-07-17T22:00:54Z" } ], "agents" : [ { - "localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ], "agentId" : "281474976710706", "agentType" : "enterprise-cluster", "ipv6Policy" : "force-ipv4", "prefix" : "99.128.0.0/11", - "agentName" : "thousandeyes-stg-va-254", - "utilization" : 25, "countryId" : "US", "enabled" : true, "network" : "AT&T Services, Inc. (AS 7018)", + "hostname" : "thousandeyes.com", + "keepBrowserCache" : true, + "agentState" : "online", + "localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ], + "agentName" : "thousandeyes-stg-va-254", + "utilization" : 25, + "testIds" : [ 281474976710706 ], "clusterMembers" : [ { "lastSeen" : "2022-07-17T22:00:54Z", "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], @@ -210,19 +214,79 @@ class TestAccountGroupsApi(unittest.TestCase): "description" : "Agent Version 0.1.1 (latest: 1.0.0)" } ] } ], - "hostname" : "thousandeyes.com", + "tests" : [ { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + } ], "lastSeen" : "2022-07-17T22:00:54Z", "createdDate" : "2022-07-17T22:00:54Z", "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], - "keepBrowserCache" : true, - "interfaceIpMappings" : [ { + "interfaceIpMapping" : [ { "ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ], "interfaceName" : "wlp4s0" }, { "ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ], "interfaceName" : "wlp4s0" } ], - "agentState" : "online", "targetForTests" : "1.1.1.1", "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], "location" : "San Francisco Bay Area", @@ -242,16 +306,20 @@ class TestAccountGroupsApi(unittest.TestCase): "description" : "Agent Version 0.1.1 (latest: 1.0.0)" } ] }, { - "localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ], "agentId" : "281474976710706", "agentType" : "enterprise-cluster", "ipv6Policy" : "force-ipv4", "prefix" : "99.128.0.0/11", - "agentName" : "thousandeyes-stg-va-254", - "utilization" : 25, "countryId" : "US", "enabled" : true, "network" : "AT&T Services, Inc. (AS 7018)", + "hostname" : "thousandeyes.com", + "keepBrowserCache" : true, + "agentState" : "online", + "localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ], + "agentName" : "thousandeyes-stg-va-254", + "utilization" : 25, + "testIds" : [ 281474976710706 ], "clusterMembers" : [ { "lastSeen" : "2022-07-17T22:00:54Z", "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], @@ -287,19 +355,79 @@ class TestAccountGroupsApi(unittest.TestCase): "description" : "Agent Version 0.1.1 (latest: 1.0.0)" } ] } ], - "hostname" : "thousandeyes.com", + "tests" : [ { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + } ], "lastSeen" : "2022-07-17T22:00:54Z", "createdDate" : "2022-07-17T22:00:54Z", "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], - "keepBrowserCache" : true, - "interfaceIpMappings" : [ { + "interfaceIpMapping" : [ { "ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ], "interfaceName" : "wlp4s0" }, { "ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ], "interfaceName" : "wlp4s0" } ], - "agentState" : "online", "targetForTests" : "1.1.1.1", "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], "location" : "San Francisco Bay Area", @@ -432,16 +560,20 @@ class TestAccountGroupsApi(unittest.TestCase): "dateRegistered" : "2022-07-17T22:00:54Z" } ], "agents" : [ { - "localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ], "agentId" : "281474976710706", "agentType" : "enterprise-cluster", "ipv6Policy" : "force-ipv4", "prefix" : "99.128.0.0/11", - "agentName" : "thousandeyes-stg-va-254", - "utilization" : 25, "countryId" : "US", "enabled" : true, "network" : "AT&T Services, Inc. (AS 7018)", + "hostname" : "thousandeyes.com", + "keepBrowserCache" : true, + "agentState" : "online", + "localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ], + "agentName" : "thousandeyes-stg-va-254", + "utilization" : 25, + "testIds" : [ 281474976710706 ], "clusterMembers" : [ { "lastSeen" : "2022-07-17T22:00:54Z", "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], @@ -477,19 +609,79 @@ class TestAccountGroupsApi(unittest.TestCase): "description" : "Agent Version 0.1.1 (latest: 1.0.0)" } ] } ], - "hostname" : "thousandeyes.com", + "tests" : [ { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + } ], "lastSeen" : "2022-07-17T22:00:54Z", "createdDate" : "2022-07-17T22:00:54Z", "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], - "keepBrowserCache" : true, - "interfaceIpMappings" : [ { + "interfaceIpMapping" : [ { "ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ], "interfaceName" : "wlp4s0" }, { "ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ], "interfaceName" : "wlp4s0" } ], - "agentState" : "online", "targetForTests" : "1.1.1.1", "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], "location" : "San Francisco Bay Area", @@ -509,16 +701,20 @@ class TestAccountGroupsApi(unittest.TestCase): "description" : "Agent Version 0.1.1 (latest: 1.0.0)" } ] }, { - "localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ], "agentId" : "281474976710706", "agentType" : "enterprise-cluster", "ipv6Policy" : "force-ipv4", "prefix" : "99.128.0.0/11", - "agentName" : "thousandeyes-stg-va-254", - "utilization" : 25, "countryId" : "US", "enabled" : true, "network" : "AT&T Services, Inc. (AS 7018)", + "hostname" : "thousandeyes.com", + "keepBrowserCache" : true, + "agentState" : "online", + "localResolutionPrefixes" : [ "10.2.3.3/24", "10.2.3.3/24" ], + "agentName" : "thousandeyes-stg-va-254", + "utilization" : 25, + "testIds" : [ 281474976710706 ], "clusterMembers" : [ { "lastSeen" : "2022-07-17T22:00:54Z", "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], @@ -554,19 +750,79 @@ class TestAccountGroupsApi(unittest.TestCase): "description" : "Agent Version 0.1.1 (latest: 1.0.0)" } ] } ], - "hostname" : "thousandeyes.com", + "tests" : [ { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + } ], "lastSeen" : "2022-07-17T22:00:54Z", "createdDate" : "2022-07-17T22:00:54Z", "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], - "keepBrowserCache" : true, - "interfaceIpMappings" : [ { + "interfaceIpMapping" : [ { "ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ], "interfaceName" : "wlp4s0" }, { "ipAddresses" : [ "73.252.207.219", "2601:646:300:3ae0::b977" ], "interfaceName" : "wlp4s0" } ], - "agentState" : "online", "targetForTests" : "1.1.1.1", "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], "location" : "San Francisco Bay Area", diff --git a/thousandeyes-sdk-agents/.openapi-generator/FILES b/thousandeyes-sdk-agents/.openapi-generator/FILES index 989be4de..bf20b0d6 100644 --- a/thousandeyes-sdk-agents/.openapi-generator/FILES +++ b/thousandeyes-sdk-agents/.openapi-generator/FILES @@ -16,6 +16,7 @@ docs/AgentProxiesApi.md docs/AgentProxy.md docs/AgentRequest.md docs/AgentResponse.md +docs/AgentTestsAssignRequest.md docs/AlertEmail.md docs/AlertIntegrationBase.md docs/AlertIntegrationType.md @@ -53,6 +54,7 @@ docs/TestInterval.md docs/TestLinks.md docs/TestSelfLink.md docs/TestType.md +docs/TestsAssignmentOnAgentsApi.md docs/UnauthorizedError.md docs/ValidationError.md docs/ValidationErrorItem.md @@ -64,6 +66,7 @@ src/thousandeyes_sdk/agents/api/agent_proxies_api.py src/thousandeyes_sdk/agents/api/cloud_and_enterprise_agent_notification_rules_api.py src/thousandeyes_sdk/agents/api/cloud_and_enterprise_agents_api.py src/thousandeyes_sdk/agents/api/enterprise_agent_cluster_api.py +src/thousandeyes_sdk/agents/api/tests_assignment_on_agents_api.py src/thousandeyes_sdk/agents/models/__init__.py src/thousandeyes_sdk/agents/models/account_group.py src/thousandeyes_sdk/agents/models/agent_base.py @@ -79,6 +82,7 @@ src/thousandeyes_sdk/agents/models/agent_proxies.py src/thousandeyes_sdk/agents/models/agent_proxy.py src/thousandeyes_sdk/agents/models/agent_request.py src/thousandeyes_sdk/agents/models/agent_response.py +src/thousandeyes_sdk/agents/models/agent_tests_assign_request.py src/thousandeyes_sdk/agents/models/alert_email.py src/thousandeyes_sdk/agents/models/alert_integration_base.py src/thousandeyes_sdk/agents/models/alert_integration_type.py @@ -122,4 +126,5 @@ test/test_agent_proxies_api.py test/test_cloud_and_enterprise_agent_notification_rules_api.py test/test_cloud_and_enterprise_agents_api.py test/test_enterprise_agent_cluster_api.py +test/test_tests_assignment_on_agents_api.py test/test_utils.py diff --git a/thousandeyes-sdk-agents/README.md b/thousandeyes-sdk-agents/README.md index 62425381..aa2afdc4 100644 --- a/thousandeyes-sdk-agents/README.md +++ b/thousandeyes-sdk-agents/README.md @@ -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.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -105,6 +105,9 @@ Class | Method | HTTP request | Description *CloudAndEnterpriseAgentsApi* | [**update_agent**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/CloudAndEnterpriseAgentsApi.md#update_agent) | **PUT** /agents/{agentId} | Update Enterprise Agent *EnterpriseAgentClusterApi* | [**assign_agent_to_cluster**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterApi.md#assign_agent_to_cluster) | **POST** /agents/{agentId}/cluster/assign | Add member to Enterprise Agent cluster *EnterpriseAgentClusterApi* | [**unassign_agent_from_cluster**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterApi.md#unassign_agent_from_cluster) | **POST** /agents/{agentId}/cluster/unassign | Remove member from Enterprise Agent cluster +*TestsAssignmentOnAgentsApi* | [**assign_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/TestsAssignmentOnAgentsApi.md#assign_tests) | **POST** /agents/{agentId}/tests/assign | Assign tests to an agent +*TestsAssignmentOnAgentsApi* | [**overwrite_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/TestsAssignmentOnAgentsApi.md#overwrite_tests) | **POST** /agents/{agentId}/tests/override | Overwrite tests assigned to an agent +*TestsAssignmentOnAgentsApi* | [**unassign_tests**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/TestsAssignmentOnAgentsApi.md#unassign_tests) | **POST** /agents/{agentId}/tests/unassign | Unassign tests from an agent ## Documentation For Models @@ -123,6 +126,7 @@ Class | Method | HTTP request | Description - [AgentProxy](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentProxy.md) - [AgentRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentRequest.md) - [AgentResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentResponse.md) + - [AgentTestsAssignRequest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AgentTestsAssignRequest.md) - [AlertEmail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AlertEmail.md) - [AlertIntegrationBase](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AlertIntegrationBase.md) - [AlertIntegrationType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-agents/docs/AlertIntegrationType.md) diff --git a/thousandeyes-sdk-agents/docs/AgentDetails.md b/thousandeyes-sdk-agents/docs/AgentDetails.md index 71bf504e..9903b368 100644 --- a/thousandeyes-sdk-agents/docs/AgentDetails.md +++ b/thousandeyes-sdk-agents/docs/AgentDetails.md @@ -19,6 +19,7 @@ Name | Type | Description | Notes **tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **labels** | [**List[AgentLabel]**](AgentLabel.md) | List of labels. See `/labels` for more information. | [optional] [readonly] **links** | [**SelfLinks**](SelfLinks.md) | | [optional] +**test_ids** | **List[int]** | List of test IDs assigned to the agent. | [optional] [readonly] **cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly] **utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] **account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional] @@ -31,7 +32,7 @@ Name | Type | Description | Notes **created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly] **target_for_tests** | **str** | Test target IP address. | [optional] **local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional] -**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] +**interface_ip_mapping** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] **notification_rules** | [**List[NotificationRules]**](NotificationRules.md) | List of notification rule objects configured on agent | [optional] ## Example diff --git a/thousandeyes-sdk-agents/docs/AgentTestsAssignRequest.md b/thousandeyes-sdk-agents/docs/AgentTestsAssignRequest.md new file mode 100644 index 00000000..06a37416 --- /dev/null +++ b/thousandeyes-sdk-agents/docs/AgentTestsAssignRequest.md @@ -0,0 +1,29 @@ +# AgentTestsAssignRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test_ids** | **List[str]** | List of test IDs to assign. You can retrieve available `testIds` using the `/agents` endpoint with the `expand=testIds` query parameter. | [optional] + +## Example + +```python +from thousandeyes_sdk.agents.models.agent_tests_assign_request import AgentTestsAssignRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentTestsAssignRequest from a JSON string +agent_tests_assign_request_instance = AgentTestsAssignRequest.from_json(json) +# print the JSON string representation of the object +print(AgentTestsAssignRequest.to_json()) + +# convert the object into a dict +agent_tests_assign_request_dict = agent_tests_assign_request_instance.to_dict() +# create an instance of AgentTestsAssignRequest from a dict +agent_tests_assign_request_from_dict = AgentTestsAssignRequest.from_dict(agent_tests_assign_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-agents/docs/CloudAndEnterpriseAgentsApi.md b/thousandeyes-sdk-agents/docs/CloudAndEnterpriseAgentsApi.md index a489e4a6..5967693d 100644 --- a/thousandeyes-sdk-agents/docs/CloudAndEnterpriseAgentsApi.md +++ b/thousandeyes-sdk-agents/docs/CloudAndEnterpriseAgentsApi.md @@ -185,7 +185,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_agents** -> CloudEnterpriseAgents get_agents(aid=aid, expand=expand, agent_types=agent_types) +> CloudEnterpriseAgents get_agents(aid=aid, expand=expand, agent_types=agent_types, labels=labels) List Cloud and Enterprise Agents @@ -226,10 +226,11 @@ 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 = [thousandeyes_sdk.agents.AgentListExpand()] # List[AgentListExpand] | Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query. (optional) agent_types = [thousandeyes_sdk.agents.CloudEnterpriseAgentType()] # List[CloudEnterpriseAgentType] | Specifies the type of agent to request. (optional) + labels = ['[\"myCustomLabeledAgent\"]'] # List[str] | Specifies the labels of the agents to request. (optional) try: # List Cloud and Enterprise Agents - api_response = api_instance.get_agents(aid=aid, expand=expand, agent_types=agent_types) + api_response = api_instance.get_agents(aid=aid, expand=expand, agent_types=agent_types, labels=labels) print("The response of CloudAndEnterpriseAgentsApi->get_agents:\n") pprint(api_response) except Exception as e: @@ -246,6 +247,7 @@ Name | Type | Description | Notes **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] **expand** | [**List[AgentListExpand]**](AgentListExpand.md)| Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query. | [optional] **agent_types** | [**List[CloudEnterpriseAgentType]**](CloudEnterpriseAgentType.md)| Specifies the type of agent to request. | [optional] + **labels** | [**List[str]**](str.md)| Specifies the labels of the agents to request. | [optional] ### Return type diff --git a/thousandeyes-sdk-agents/docs/CloudEnterpriseAgent.md b/thousandeyes-sdk-agents/docs/CloudEnterpriseAgent.md index acd68b85..514baa55 100644 --- a/thousandeyes-sdk-agents/docs/CloudEnterpriseAgent.md +++ b/thousandeyes-sdk-agents/docs/CloudEnterpriseAgent.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] **prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly] **verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**test_ids** | **List[int]** | List of test IDs assigned to the agent. | [optional] [readonly] +**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly] **utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] **account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional] @@ -28,7 +30,7 @@ Name | Type | Description | Notes **created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly] **target_for_tests** | **str** | Test target IP address. | [optional] **local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional] -**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] +**interface_ip_mapping** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-agents/docs/EnterpriseAgent.md b/thousandeyes-sdk-agents/docs/EnterpriseAgent.md index 6747f803..6f8a4d02 100644 --- a/thousandeyes-sdk-agents/docs/EnterpriseAgent.md +++ b/thousandeyes-sdk-agents/docs/EnterpriseAgent.md @@ -16,6 +16,8 @@ Name | Type | Description | Notes **enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] **prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly] **verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**test_ids** | **List[int]** | List of test IDs assigned to the agent. | [optional] [readonly] +**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly] **utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] **account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional] @@ -28,7 +30,7 @@ Name | Type | Description | Notes **created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly] **target_for_tests** | **str** | Test target IP address. | [optional] **local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional] -**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] +**interface_ip_mapping** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterDetail.md b/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterDetail.md index cc080fb0..b259ec2f 100644 --- a/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterDetail.md +++ b/thousandeyes-sdk-agents/docs/EnterpriseAgentClusterDetail.md @@ -15,6 +15,8 @@ Name | Type | Description | Notes **enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] **prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly] **verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**test_ids** | **List[int]** | List of test IDs assigned to the agent. | [optional] [readonly] +**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly] **utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] **account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional] @@ -27,8 +29,7 @@ Name | Type | Description | Notes **created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly] **target_for_tests** | **str** | Test target IP address. | [optional] **local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional] -**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] -**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] +**interface_ip_mapping** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] **notification_rules** | [**List[NotificationRules]**](NotificationRules.md) | List of notification rule objects configured on agent | [optional] **labels** | [**List[AgentLabel]**](AgentLabel.md) | List of labels. See `/labels` for more information. | [optional] [readonly] **agent_type** | **str** | Enterprise Cluster agent type. | diff --git a/thousandeyes-sdk-agents/docs/EnterpriseAgentData.md b/thousandeyes-sdk-agents/docs/EnterpriseAgentData.md index 9d6dceee..79152a22 100644 --- a/thousandeyes-sdk-agents/docs/EnterpriseAgentData.md +++ b/thousandeyes-sdk-agents/docs/EnterpriseAgentData.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**test_ids** | **List[int]** | List of test IDs assigned to the agent. | [optional] [readonly] +**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly] **utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] **account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional] @@ -17,7 +19,7 @@ Name | Type | Description | Notes **created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly] **target_for_tests** | **str** | Test target IP address. | [optional] **local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional] -**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] +**interface_ip_mapping** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-agents/docs/EnterpriseAgentDetail.md b/thousandeyes-sdk-agents/docs/EnterpriseAgentDetail.md index 2b5c40a4..ce522e0b 100644 --- a/thousandeyes-sdk-agents/docs/EnterpriseAgentDetail.md +++ b/thousandeyes-sdk-agents/docs/EnterpriseAgentDetail.md @@ -15,6 +15,8 @@ Name | Type | Description | Notes **enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] **prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly] **verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**test_ids** | **List[int]** | List of test IDs assigned to the agent. | [optional] [readonly] +**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly] **utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] **account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional] @@ -27,8 +29,7 @@ Name | Type | Description | Notes **created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly] **target_for_tests** | **str** | Test target IP address. | [optional] **local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional] -**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] -**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] +**interface_ip_mapping** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] **notification_rules** | [**List[NotificationRules]**](NotificationRules.md) | List of notification rule objects configured on agent | [optional] **labels** | [**List[AgentLabel]**](AgentLabel.md) | List of labels. See `/labels` for more information. | [optional] [readonly] **agent_type** | **str** | Enterprise agent type. | diff --git a/thousandeyes-sdk-agents/docs/EnterpriseAgentResponseExpands.md b/thousandeyes-sdk-agents/docs/EnterpriseAgentResponseExpands.md index 9467582f..58fa9e89 100644 --- a/thousandeyes-sdk-agents/docs/EnterpriseAgentResponseExpands.md +++ b/thousandeyes-sdk-agents/docs/EnterpriseAgentResponseExpands.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**test_ids** | **List[int]** | List of test IDs assigned to the agent. | [optional] [readonly] **tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **notification_rules** | [**List[NotificationRules]**](NotificationRules.md) | List of notification rule objects configured on agent | [optional] **labels** | [**List[AgentLabel]**](AgentLabel.md) | List of labels. See `/labels` for more information. | [optional] [readonly] diff --git a/thousandeyes-sdk-agents/docs/SimpleEnterpriseAgent.md b/thousandeyes-sdk-agents/docs/SimpleEnterpriseAgent.md index 0fab5e8c..fe588d5f 100644 --- a/thousandeyes-sdk-agents/docs/SimpleEnterpriseAgent.md +++ b/thousandeyes-sdk-agents/docs/SimpleEnterpriseAgent.md @@ -15,6 +15,8 @@ Name | Type | Description | Notes **enabled** | **bool** | Flag indicating if the agent is enabled. | [optional] **prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly] **verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests. | [optional] [readonly] +**test_ids** | **List[int]** | List of test IDs assigned to the agent. | [optional] [readonly] +**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See `/tests` for more information. | [optional] **cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly] **utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly] **account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional] @@ -27,7 +29,7 @@ Name | Type | Description | Notes **created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly] **target_for_tests** | **str** | Test target IP address. | [optional] **local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional] -**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] +**interface_ip_mapping** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly] ## Example diff --git a/thousandeyes-sdk-agents/docs/TestsAssignmentOnAgentsApi.md b/thousandeyes-sdk-agents/docs/TestsAssignmentOnAgentsApi.md new file mode 100644 index 00000000..9822e88f --- /dev/null +++ b/thousandeyes-sdk-agents/docs/TestsAssignmentOnAgentsApi.md @@ -0,0 +1,284 @@ +# thousandeyes_sdk.agents.TestsAssignmentOnAgentsApi + +All URIs are relative to *https://api.thousandeyes.com/v7* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**assign_tests**](TestsAssignmentOnAgentsApi.md#assign_tests) | **POST** /agents/{agentId}/tests/assign | Assign tests to an agent +[**overwrite_tests**](TestsAssignmentOnAgentsApi.md#overwrite_tests) | **POST** /agents/{agentId}/tests/override | Overwrite tests assigned to an agent +[**unassign_tests**](TestsAssignmentOnAgentsApi.md#unassign_tests) | **POST** /agents/{agentId}/tests/unassign | Unassign tests from an agent + + +# **assign_tests** +> AgentDetails assign_tests(agent_id, agent_tests_assign_request, aid=aid) + +Assign tests to an agent + +Assign tests to a specific Agent. Existing assigned tests are not removed. **Important notes:** * The operation fails if the specified agent does not exist. * If any provided test ID is invalid, the entire operation is canceled. * Already assigned tests are ignored; other valid tests will be assigned. * This operation does not overwrite existing assignments. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.agents +from thousandeyes_sdk.agents.models.agent_details import AgentDetails +from thousandeyes_sdk.agents.models.agent_tests_assign_request import AgentTestsAssignRequest +from thousandeyes_sdk.agents.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.agents.TestsAssignmentOnAgentsApi(api_client) + agent_id = '281474976710706' # str | Unique ID for the Enterprise Agent cluster to add new agents to. + agent_tests_assign_request = thousandeyes_sdk.agents.AgentTestsAssignRequest() # AgentTestsAssignRequest | + 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: + # Assign tests to an agent + api_response = api_instance.assign_tests(agent_id, agent_tests_assign_request, aid=aid) + print("The response of TestsAssignmentOnAgentsApi->assign_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestsAssignmentOnAgentsApi->assign_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| Unique ID for the Enterprise Agent cluster to add new agents to. | + **agent_tests_assign_request** | [**AgentTestsAssignRequest**](AgentTestsAssignRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**AgentDetails**](AgentDetails.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** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **overwrite_tests** +> AgentDetails overwrite_tests(agent_id, agent_tests_assign_request, aid=aid) + +Overwrite tests assigned to an agent + +Replaces all tests assigned to a specific agent with the new set of test IDs provided. **Important notes:** * The operation fails if the specified agent does not exist. * If any test ID is invalid, the operation is canceled and no changes are made. * Already assigned tests that are also in the request are ignored. * Previously assigned tests not included in the request will be removed. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.agents +from thousandeyes_sdk.agents.models.agent_details import AgentDetails +from thousandeyes_sdk.agents.models.agent_tests_assign_request import AgentTestsAssignRequest +from thousandeyes_sdk.agents.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.agents.TestsAssignmentOnAgentsApi(api_client) + agent_id = '281474976710706' # str | Unique ID for the Enterprise Agent cluster to add new agents to. + agent_tests_assign_request = thousandeyes_sdk.agents.AgentTestsAssignRequest() # AgentTestsAssignRequest | + 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: + # Overwrite tests assigned to an agent + api_response = api_instance.overwrite_tests(agent_id, agent_tests_assign_request, aid=aid) + print("The response of TestsAssignmentOnAgentsApi->overwrite_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestsAssignmentOnAgentsApi->overwrite_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| Unique ID for the Enterprise Agent cluster to add new agents to. | + **agent_tests_assign_request** | [**AgentTestsAssignRequest**](AgentTestsAssignRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**AgentDetails**](AgentDetails.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** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **unassign_tests** +> AgentDetails unassign_tests(agent_id, agent_tests_assign_request, aid=aid) + +Unassign tests from an agent + +Unassigns the specified tests from a specific agent. **Important notes:** * The operation fails if the specified agent does not exist. * If any test ID is invalid, the operation is canceled and no changes are made. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.agents +from thousandeyes_sdk.agents.models.agent_details import AgentDetails +from thousandeyes_sdk.agents.models.agent_tests_assign_request import AgentTestsAssignRequest +from thousandeyes_sdk.agents.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.agents.TestsAssignmentOnAgentsApi(api_client) + agent_id = '281474976710706' # str | Unique ID for the Enterprise Agent cluster to add new agents to. + agent_tests_assign_request = thousandeyes_sdk.agents.AgentTestsAssignRequest() # AgentTestsAssignRequest | + 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: + # Unassign tests from an agent + api_response = api_instance.unassign_tests(agent_id, agent_tests_assign_request, aid=aid) + print("The response of TestsAssignmentOnAgentsApi->unassign_tests:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TestsAssignmentOnAgentsApi->unassign_tests: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **agent_id** | **str**| Unique ID for the Enterprise Agent cluster to add new agents to. | + **agent_tests_assign_request** | [**AgentTestsAssignRequest**](AgentTestsAssignRequest.md)| | + **aid** | **str**| A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional] + +### Return type + +[**AgentDetails**](AgentDetails.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** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/__init__.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/__init__.py index 495bae9a..c631349f 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/__init__.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/__init__.py @@ -18,6 +18,7 @@ from thousandeyes_sdk.agents.api.agent_proxies_api import AgentProxiesApi from thousandeyes_sdk.agents.api.cloud_and_enterprise_agent_notification_rules_api import CloudAndEnterpriseAgentNotificationRulesApi from thousandeyes_sdk.agents.api.cloud_and_enterprise_agents_api import CloudAndEnterpriseAgentsApi from thousandeyes_sdk.agents.api.enterprise_agent_cluster_api import EnterpriseAgentClusterApi +from thousandeyes_sdk.agents.api.tests_assignment_on_agents_api import TestsAssignmentOnAgentsApi # import models into sdk package @@ -35,6 +36,7 @@ from thousandeyes_sdk.agents.models.agent_proxies import AgentProxies from thousandeyes_sdk.agents.models.agent_proxy import AgentProxy from thousandeyes_sdk.agents.models.agent_request import AgentRequest from thousandeyes_sdk.agents.models.agent_response import AgentResponse +from thousandeyes_sdk.agents.models.agent_tests_assign_request import AgentTestsAssignRequest from thousandeyes_sdk.agents.models.alert_email import AlertEmail from thousandeyes_sdk.agents.models.alert_integration_base import AlertIntegrationBase from thousandeyes_sdk.agents.models.alert_integration_type import AlertIntegrationType diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/__init__.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/__init__.py index 84b34086..c030c40a 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/__init__.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/__init__.py @@ -5,4 +5,5 @@ from thousandeyes_sdk.agents.api.agent_proxies_api import AgentProxiesApi from thousandeyes_sdk.agents.api.cloud_and_enterprise_agent_notification_rules_api import CloudAndEnterpriseAgentNotificationRulesApi from thousandeyes_sdk.agents.api.cloud_and_enterprise_agents_api import CloudAndEnterpriseAgentsApi from thousandeyes_sdk.agents.api.enterprise_agent_cluster_api import EnterpriseAgentClusterApi +from thousandeyes_sdk.agents.api.tests_assignment_on_agents_api import TestsAssignmentOnAgentsApi diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/cloud_and_enterprise_agents_api.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/cloud_and_enterprise_agents_api.py index 127df271..826ded60 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/cloud_and_enterprise_agents_api.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/cloud_and_enterprise_agents_api.py @@ -664,6 +664,7 @@ class CloudAndEnterpriseAgentsApi: aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, expand: Annotated[Optional[List[AgentListExpand]], Field(description="Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.")] = None, agent_types: Annotated[Optional[List[CloudEnterpriseAgentType]], Field(description="Specifies the type of agent to request.")] = None, + labels: Annotated[Optional[List[StrictStr]], Field(description="Specifies the labels of the agents to request.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -687,6 +688,8 @@ class CloudAndEnterpriseAgentsApi: :type expand: List[AgentListExpand] :param agent_types: Specifies the type of agent to request. :type agent_types: List[CloudEnterpriseAgentType] + :param labels: Specifies the labels of the agents to request. + :type labels: 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 @@ -713,6 +716,7 @@ class CloudAndEnterpriseAgentsApi: aid=aid, expand=expand, agent_types=agent_types, + labels=labels, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -746,6 +750,7 @@ class CloudAndEnterpriseAgentsApi: aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, expand: Annotated[Optional[List[AgentListExpand]], Field(description="Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.")] = None, agent_types: Annotated[Optional[List[CloudEnterpriseAgentType]], Field(description="Specifies the type of agent to request.")] = None, + labels: Annotated[Optional[List[StrictStr]], Field(description="Specifies the labels of the agents to request.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -769,6 +774,8 @@ class CloudAndEnterpriseAgentsApi: :type expand: List[AgentListExpand] :param agent_types: Specifies the type of agent to request. :type agent_types: List[CloudEnterpriseAgentType] + :param labels: Specifies the labels of the agents to request. + :type labels: 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 @@ -795,6 +802,7 @@ class CloudAndEnterpriseAgentsApi: aid=aid, expand=expand, agent_types=agent_types, + labels=labels, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -828,6 +836,7 @@ class CloudAndEnterpriseAgentsApi: aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, expand: Annotated[Optional[List[AgentListExpand]], Field(description="Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.")] = None, agent_types: Annotated[Optional[List[CloudEnterpriseAgentType]], Field(description="Specifies the type of agent to request.")] = None, + labels: Annotated[Optional[List[StrictStr]], Field(description="Specifies the labels of the agents to request.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -851,6 +860,8 @@ class CloudAndEnterpriseAgentsApi: :type expand: List[AgentListExpand] :param agent_types: Specifies the type of agent to request. :type agent_types: List[CloudEnterpriseAgentType] + :param labels: Specifies the labels of the agents to request. + :type labels: 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 @@ -877,6 +888,7 @@ class CloudAndEnterpriseAgentsApi: aid=aid, expand=expand, agent_types=agent_types, + labels=labels, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -904,6 +916,7 @@ class CloudAndEnterpriseAgentsApi: aid, expand, agent_types, + labels, _request_auth, _content_type, _headers, @@ -915,6 +928,7 @@ class CloudAndEnterpriseAgentsApi: _collection_formats: Dict[str, str] = { 'expand': 'csv', 'agentTypes': 'csv', + 'labels': 'csv', } _path_params: Dict[str, str] = {} @@ -938,6 +952,10 @@ class CloudAndEnterpriseAgentsApi: _query_params.append(('agentTypes', agent_types)) + if labels is not None: + + _query_params.append(('labels', labels)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/tests_assignment_on_agents_api.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/tests_assignment_on_agents_api.py new file mode 100644 index 00000000..14dafb77 --- /dev/null +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/api/tests_assignment_on_agents_api.py @@ -0,0 +1,1027 @@ +# coding: utf-8 + +""" + Agents API + + ## Overview Manage Cloud and Enterprise Agents available to your account in ThousandEyes. + + 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.agents.models + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.agents.models.agent_details import AgentDetails +from thousandeyes_sdk.agents.models.agent_tests_assign_request import AgentTestsAssignRequest + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class TestsAssignmentOnAgentsApi: + """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-agents")) + self.api_client = api_client + + + @validate_call + def assign_tests( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")], + agent_tests_assign_request: AgentTestsAssignRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentDetails: + """Assign tests to an agent + + Assign tests to a specific Agent. Existing assigned tests are not removed. **Important notes:** * The operation fails if the specified agent does not exist. * If any provided test ID is invalid, the entire operation is canceled. * Already assigned tests are ignored; other valid tests will be assigned. * This operation does not overwrite existing assignments. + + :param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required) + :type agent_id: str + :param agent_tests_assign_request: (required) + :type agent_tests_assign_request: AgentTestsAssignRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_tests_serialize( + agent_id=agent_id, + agent_tests_assign_request=agent_tests_assign_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentDetails", + '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.agents.models, + ).data + + + @validate_call + def assign_tests_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")], + agent_tests_assign_request: AgentTestsAssignRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AgentDetails]: + """Assign tests to an agent + + Assign tests to a specific Agent. Existing assigned tests are not removed. **Important notes:** * The operation fails if the specified agent does not exist. * If any provided test ID is invalid, the entire operation is canceled. * Already assigned tests are ignored; other valid tests will be assigned. * This operation does not overwrite existing assignments. + + :param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required) + :type agent_id: str + :param agent_tests_assign_request: (required) + :type agent_tests_assign_request: AgentTestsAssignRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_tests_serialize( + agent_id=agent_id, + agent_tests_assign_request=agent_tests_assign_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentDetails", + '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.agents.models, + ) + + + @validate_call + def assign_tests_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")], + agent_tests_assign_request: AgentTestsAssignRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Assign tests to an agent + + Assign tests to a specific Agent. Existing assigned tests are not removed. **Important notes:** * The operation fails if the specified agent does not exist. * If any provided test ID is invalid, the entire operation is canceled. * Already assigned tests are ignored; other valid tests will be assigned. * This operation does not overwrite existing assignments. + + :param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required) + :type agent_id: str + :param agent_tests_assign_request: (required) + :type agent_tests_assign_request: AgentTestsAssignRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assign_tests_serialize( + agent_id=agent_id, + agent_tests_assign_request=agent_tests_assign_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentDetails", + '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 _assign_tests_serialize( + self, + agent_id, + agent_tests_assign_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agentId'] = agent_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_tests_assign_request is not None: + _body_params = agent_tests_assign_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/agents/{agentId}/tests/assign', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def overwrite_tests( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")], + agent_tests_assign_request: AgentTestsAssignRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentDetails: + """Overwrite tests assigned to an agent + + Replaces all tests assigned to a specific agent with the new set of test IDs provided. **Important notes:** * The operation fails if the specified agent does not exist. * If any test ID is invalid, the operation is canceled and no changes are made. * Already assigned tests that are also in the request are ignored. * Previously assigned tests not included in the request will be removed. + + :param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required) + :type agent_id: str + :param agent_tests_assign_request: (required) + :type agent_tests_assign_request: AgentTestsAssignRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._overwrite_tests_serialize( + agent_id=agent_id, + agent_tests_assign_request=agent_tests_assign_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentDetails", + '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.agents.models, + ).data + + + @validate_call + def overwrite_tests_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")], + agent_tests_assign_request: AgentTestsAssignRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AgentDetails]: + """Overwrite tests assigned to an agent + + Replaces all tests assigned to a specific agent with the new set of test IDs provided. **Important notes:** * The operation fails if the specified agent does not exist. * If any test ID is invalid, the operation is canceled and no changes are made. * Already assigned tests that are also in the request are ignored. * Previously assigned tests not included in the request will be removed. + + :param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required) + :type agent_id: str + :param agent_tests_assign_request: (required) + :type agent_tests_assign_request: AgentTestsAssignRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._overwrite_tests_serialize( + agent_id=agent_id, + agent_tests_assign_request=agent_tests_assign_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentDetails", + '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.agents.models, + ) + + + @validate_call + def overwrite_tests_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")], + agent_tests_assign_request: AgentTestsAssignRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Overwrite tests assigned to an agent + + Replaces all tests assigned to a specific agent with the new set of test IDs provided. **Important notes:** * The operation fails if the specified agent does not exist. * If any test ID is invalid, the operation is canceled and no changes are made. * Already assigned tests that are also in the request are ignored. * Previously assigned tests not included in the request will be removed. + + :param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required) + :type agent_id: str + :param agent_tests_assign_request: (required) + :type agent_tests_assign_request: AgentTestsAssignRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._overwrite_tests_serialize( + agent_id=agent_id, + agent_tests_assign_request=agent_tests_assign_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentDetails", + '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 _overwrite_tests_serialize( + self, + agent_id, + agent_tests_assign_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agentId'] = agent_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_tests_assign_request is not None: + _body_params = agent_tests_assign_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/agents/{agentId}/tests/override', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def unassign_tests( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")], + agent_tests_assign_request: AgentTestsAssignRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AgentDetails: + """Unassign tests from an agent + + Unassigns the specified tests from a specific agent. **Important notes:** * The operation fails if the specified agent does not exist. * If any test ID is invalid, the operation is canceled and no changes are made. + + :param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required) + :type agent_id: str + :param agent_tests_assign_request: (required) + :type agent_tests_assign_request: AgentTestsAssignRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_tests_serialize( + agent_id=agent_id, + agent_tests_assign_request=agent_tests_assign_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentDetails", + '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.agents.models, + ).data + + + @validate_call + def unassign_tests_with_http_info( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")], + agent_tests_assign_request: AgentTestsAssignRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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[AgentDetails]: + """Unassign tests from an agent + + Unassigns the specified tests from a specific agent. **Important notes:** * The operation fails if the specified agent does not exist. * If any test ID is invalid, the operation is canceled and no changes are made. + + :param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required) + :type agent_id: str + :param agent_tests_assign_request: (required) + :type agent_tests_assign_request: AgentTestsAssignRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_tests_serialize( + agent_id=agent_id, + agent_tests_assign_request=agent_tests_assign_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentDetails", + '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.agents.models, + ) + + + @validate_call + def unassign_tests_without_preload_content( + self, + agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")], + agent_tests_assign_request: AgentTestsAssignRequest, + aid: Annotated[Optional[StrictStr], Field(description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Unassign tests from an agent + + Unassigns the specified tests from a specific agent. **Important notes:** * The operation fails if the specified agent does not exist. * If any test ID is invalid, the operation is canceled and no changes are made. + + :param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required) + :type agent_id: str + :param agent_tests_assign_request: (required) + :type agent_tests_assign_request: AgentTestsAssignRequest + :param aid: A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unassign_tests_serialize( + agent_id=agent_id, + agent_tests_assign_request=agent_tests_assign_request, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AgentDetails", + '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 _unassign_tests_serialize( + self, + agent_id, + agent_tests_assign_request, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if agent_id is not None: + _path_params['agentId'] = agent_id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + if agent_tests_assign_request is not None: + _body_params = agent_tests_assign_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/agents/{agentId}/tests/unassign', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/__init__.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/__init__.py index f54b36ce..47c1c0b4 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/__init__.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/__init__.py @@ -27,6 +27,7 @@ from thousandeyes_sdk.agents.models.agent_proxies import AgentProxies from thousandeyes_sdk.agents.models.agent_proxy import AgentProxy from thousandeyes_sdk.agents.models.agent_request import AgentRequest from thousandeyes_sdk.agents.models.agent_response import AgentResponse +from thousandeyes_sdk.agents.models.agent_tests_assign_request import AgentTestsAssignRequest from thousandeyes_sdk.agents.models.alert_email import AlertEmail from thousandeyes_sdk.agents.models.alert_integration_base import AlertIntegrationBase from thousandeyes_sdk.agents.models.alert_integration_type import AlertIntegrationType diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_details_expand.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_details_expand.py index 1601bee8..65dd6c8f 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_details_expand.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_details_expand.py @@ -27,6 +27,7 @@ class AgentDetailsExpand(str, Enum): """ CLUSTER_MINUS_MEMBER = 'cluster-member' TEST = 'test' + TEST_MINUS_IDS = 'test-ids' NOTIFICATION_MINUS_RULE = 'notification-rule' UNKNOWN = 'unknown' diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_list_expand.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_list_expand.py index 6fa87403..ae3059c0 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_list_expand.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_list_expand.py @@ -26,6 +26,8 @@ class AgentListExpand(str, Enum): allowed enum values """ CLUSTER_MINUS_MEMBER = 'cluster-member' + TEST = 'test' + TEST_MINUS_IDS = 'test-ids' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_tests_assign_request.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_tests_assign_request.py new file mode 100644 index 00000000..b723a055 --- /dev/null +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/agent_tests_assign_request.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Agents API + + ## Overview Manage Cloud and Enterprise Agents available to your account in ThousandEyes. + + Generated by OpenAPI Generator (https://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 AgentTestsAssignRequest(BaseModel): + """ + AgentTestsAssignRequest + """ # noqa: E501 + test_ids: Optional[List[StrictStr]] = Field(default=None, description="List of test IDs to assign. You can retrieve available `testIds` using the `/agents` endpoint with the `expand=testIds` query parameter. ", alias="testIds") + __properties: ClassVar[List[str]] = ["testIds"] + + 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 AgentTestsAssignRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 AgentTestsAssignRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "testIds": obj.get("testIds") + }) + return _obj + + diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent.py index 5cdd9793..5575c5fc 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent.py @@ -26,6 +26,7 @@ from thousandeyes_sdk.agents.models.enterprise_agent_ipv6_policy import Enterpri from thousandeyes_sdk.agents.models.enterprise_agent_state import EnterpriseAgentState from thousandeyes_sdk.agents.models.error_detail import ErrorDetail from thousandeyes_sdk.agents.models.interface_ip_mapping import InterfaceIpMapping +from thousandeyes_sdk.agents.models.simple_test import SimpleTest from typing import Optional, Set from typing_extensions import Self @@ -44,6 +45,8 @@ class EnterpriseAgent(BaseModel): enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.") prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.") verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates") + test_ids: Optional[List[StrictInt]] = Field(default=None, description="List of test IDs assigned to the agent.", alias="testIds") + tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers") utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).") account_groups: Optional[List[AccountGroup]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups") @@ -56,8 +59,8 @@ class EnterpriseAgent(BaseModel): created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate") target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests") local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes") - interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings") - __properties: ClassVar[List[str]] = ["agentType", "ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings"] + interface_ip_mapping: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMapping") + __properties: ClassVar[List[str]] = ["agentType", "ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "testIds", "tests", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMapping"] model_config = ConfigDict( populate_by_name=True, @@ -105,6 +108,7 @@ class EnterpriseAgent(BaseModel): * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "ip_addresses", @@ -115,13 +119,14 @@ class EnterpriseAgent(BaseModel): "country_id", "prefix", "verify_ssl_certificates", + "test_ids", "cluster_members", "utilization", "error_details", "hostname", "last_seen", "created_date", - "interface_ip_mappings", + "interface_ip_mapping", ]) _dict = self.model_dump( @@ -129,6 +134,13 @@ class EnterpriseAgent(BaseModel): exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items # override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list) _items = [] if self.cluster_members: @@ -150,13 +162,13 @@ class EnterpriseAgent(BaseModel): if _item: _items.append(_item.to_dict()) _dict['errorDetails'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list) + # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mapping (list) _items = [] - if self.interface_ip_mappings: - for _item in self.interface_ip_mappings: + if self.interface_ip_mapping: + for _item in self.interface_ip_mapping: if _item: _items.append(_item.to_dict()) - _dict['interfaceIpMappings'] = _items + _dict['interfaceIpMapping'] = _items return _dict @classmethod @@ -180,6 +192,8 @@ class EnterpriseAgent(BaseModel): "enabled": obj.get("enabled"), "prefix": obj.get("prefix"), "verifySslCertificates": obj.get("verifySslCertificates"), + "testIds": obj.get("testIds"), + "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "clusterMembers": [ClusterMember.from_dict(_item) for _item in obj["clusterMembers"]] if obj.get("clusterMembers") is not None else None, "utilization": obj.get("utilization"), "accountGroups": [AccountGroup.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None, @@ -192,7 +206,7 @@ class EnterpriseAgent(BaseModel): "createdDate": obj.get("createdDate"), "targetForTests": obj.get("targetForTests"), "localResolutionPrefixes": obj.get("localResolutionPrefixes"), - "interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMappings"]] if obj.get("interfaceIpMappings") is not None else None + "interfaceIpMapping": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMapping"]] if obj.get("interfaceIpMapping") is not None else None }) return _obj diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_cluster_detail.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_cluster_detail.py index 7698a531..63b8281a 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_cluster_detail.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_cluster_detail.py @@ -47,6 +47,8 @@ class EnterpriseAgentClusterDetail(BaseModel): enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.") prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.") verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates") + test_ids: Optional[List[StrictInt]] = Field(default=None, description="List of test IDs assigned to the agent.", alias="testIds") + tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers") utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).") account_groups: Optional[List[AccountGroup]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups") @@ -59,13 +61,12 @@ class EnterpriseAgentClusterDetail(BaseModel): created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate") target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests") local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes") - interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings") - tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") + interface_ip_mapping: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMapping") notification_rules: Optional[List[NotificationRules]] = Field(default=None, description="List of notification rule objects configured on agent", alias="notificationRules") labels: Optional[List[AgentLabel]] = Field(default=None, description="List of labels. See `/labels` for more information.") agent_type: Annotated[str, Field(strict=True)] = Field(description="Enterprise Cluster agent type.", alias="agentType") links: Optional[SelfLinks] = Field(default=None, alias="_links") - __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings", "tests", "notificationRules", "labels", "agentType", "_links"] + __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "testIds", "tests", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMapping", "notificationRules", "labels", "agentType", "_links"] @field_validator('agent_type') def agent_type_validate_regular_expression(cls, value): @@ -121,6 +122,7 @@ class EnterpriseAgentClusterDetail(BaseModel): * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "ip_addresses", @@ -131,13 +133,14 @@ class EnterpriseAgentClusterDetail(BaseModel): "country_id", "prefix", "verify_ssl_certificates", + "test_ids", "cluster_members", "utilization", "error_details", "hostname", "last_seen", "created_date", - "interface_ip_mappings", + "interface_ip_mapping", "labels", ]) @@ -146,6 +149,13 @@ class EnterpriseAgentClusterDetail(BaseModel): exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items # override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list) _items = [] if self.cluster_members: @@ -167,20 +177,13 @@ class EnterpriseAgentClusterDetail(BaseModel): if _item: _items.append(_item.to_dict()) _dict['errorDetails'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list) + # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mapping (list) _items = [] - if self.interface_ip_mappings: - for _item in self.interface_ip_mappings: + if self.interface_ip_mapping: + for _item in self.interface_ip_mapping: if _item: _items.append(_item.to_dict()) - _dict['interfaceIpMappings'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in tests (list) - _items = [] - if self.tests: - for _item in self.tests: - if _item: - _items.append(_item.to_dict()) - _dict['tests'] = _items + _dict['interfaceIpMapping'] = _items # override the default output from pydantic by calling `to_dict()` of each item in notification_rules (list) _items = [] if self.notification_rules: @@ -220,6 +223,8 @@ class EnterpriseAgentClusterDetail(BaseModel): "enabled": obj.get("enabled"), "prefix": obj.get("prefix"), "verifySslCertificates": obj.get("verifySslCertificates"), + "testIds": obj.get("testIds"), + "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "clusterMembers": [ClusterMember.from_dict(_item) for _item in obj["clusterMembers"]] if obj.get("clusterMembers") is not None else None, "utilization": obj.get("utilization"), "accountGroups": [AccountGroup.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None, @@ -232,8 +237,7 @@ class EnterpriseAgentClusterDetail(BaseModel): "createdDate": obj.get("createdDate"), "targetForTests": obj.get("targetForTests"), "localResolutionPrefixes": obj.get("localResolutionPrefixes"), - "interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMappings"]] if obj.get("interfaceIpMappings") is not None else None, - "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, + "interfaceIpMapping": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMapping"]] if obj.get("interfaceIpMapping") is not None else None, "notificationRules": [NotificationRules.from_dict(_item) for _item in obj["notificationRules"]] if obj.get("notificationRules") is not None else None, "labels": [AgentLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "agentType": obj.get("agentType"), diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_data.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_data.py index 3a32f1a7..8adde47f 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_data.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_data.py @@ -25,6 +25,7 @@ from thousandeyes_sdk.agents.models.enterprise_agent_ipv6_policy import Enterpri from thousandeyes_sdk.agents.models.enterprise_agent_state import EnterpriseAgentState from thousandeyes_sdk.agents.models.error_detail import ErrorDetail from thousandeyes_sdk.agents.models.interface_ip_mapping import InterfaceIpMapping +from thousandeyes_sdk.agents.models.simple_test import SimpleTest from typing import Optional, Set from typing_extensions import Self @@ -32,6 +33,8 @@ class EnterpriseAgentData(BaseModel): """ EnterpriseAgentData """ # noqa: E501 + test_ids: Optional[List[StrictInt]] = Field(default=None, description="List of test IDs assigned to the agent.", alias="testIds") + tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers") utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).") account_groups: Optional[List[AccountGroup]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups") @@ -44,8 +47,8 @@ class EnterpriseAgentData(BaseModel): created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate") target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests") local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes") - interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings") - __properties: ClassVar[List[str]] = ["clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings"] + interface_ip_mapping: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMapping") + __properties: ClassVar[List[str]] = ["testIds", "tests", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMapping"] model_config = ConfigDict( populate_by_name=True, @@ -85,15 +88,17 @@ class EnterpriseAgentData(BaseModel): * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ + "test_ids", "cluster_members", "utilization", "error_details", "hostname", "last_seen", "created_date", - "interface_ip_mappings", + "interface_ip_mapping", ]) _dict = self.model_dump( @@ -101,6 +106,13 @@ class EnterpriseAgentData(BaseModel): exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items # override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list) _items = [] if self.cluster_members: @@ -122,13 +134,13 @@ class EnterpriseAgentData(BaseModel): if _item: _items.append(_item.to_dict()) _dict['errorDetails'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list) + # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mapping (list) _items = [] - if self.interface_ip_mappings: - for _item in self.interface_ip_mappings: + if self.interface_ip_mapping: + for _item in self.interface_ip_mapping: if _item: _items.append(_item.to_dict()) - _dict['interfaceIpMappings'] = _items + _dict['interfaceIpMapping'] = _items return _dict @classmethod @@ -141,6 +153,8 @@ class EnterpriseAgentData(BaseModel): return cls.model_validate(obj) _obj = cls.model_validate({ + "testIds": obj.get("testIds"), + "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "clusterMembers": [ClusterMember.from_dict(_item) for _item in obj["clusterMembers"]] if obj.get("clusterMembers") is not None else None, "utilization": obj.get("utilization"), "accountGroups": [AccountGroup.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None, @@ -153,7 +167,7 @@ class EnterpriseAgentData(BaseModel): "createdDate": obj.get("createdDate"), "targetForTests": obj.get("targetForTests"), "localResolutionPrefixes": obj.get("localResolutionPrefixes"), - "interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMappings"]] if obj.get("interfaceIpMappings") is not None else None + "interfaceIpMapping": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMapping"]] if obj.get("interfaceIpMapping") is not None else None }) return _obj diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_detail.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_detail.py index 1dcc0cf9..9240d731 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_detail.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_detail.py @@ -47,6 +47,8 @@ class EnterpriseAgentDetail(BaseModel): enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.") prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.") verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates") + test_ids: Optional[List[StrictInt]] = Field(default=None, description="List of test IDs assigned to the agent.", alias="testIds") + tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers") utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).") account_groups: Optional[List[AccountGroup]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups") @@ -59,13 +61,12 @@ class EnterpriseAgentDetail(BaseModel): created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate") target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests") local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes") - interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings") - tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") + interface_ip_mapping: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMapping") notification_rules: Optional[List[NotificationRules]] = Field(default=None, description="List of notification rule objects configured on agent", alias="notificationRules") labels: Optional[List[AgentLabel]] = Field(default=None, description="List of labels. See `/labels` for more information.") agent_type: Annotated[str, Field(strict=True)] = Field(description="Enterprise agent type.", alias="agentType") links: Optional[SelfLinks] = Field(default=None, alias="_links") - __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings", "tests", "notificationRules", "labels", "agentType", "_links"] + __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "testIds", "tests", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMapping", "notificationRules", "labels", "agentType", "_links"] @field_validator('agent_type') def agent_type_validate_regular_expression(cls, value): @@ -121,6 +122,7 @@ class EnterpriseAgentDetail(BaseModel): * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "ip_addresses", @@ -131,13 +133,14 @@ class EnterpriseAgentDetail(BaseModel): "country_id", "prefix", "verify_ssl_certificates", + "test_ids", "cluster_members", "utilization", "error_details", "hostname", "last_seen", "created_date", - "interface_ip_mappings", + "interface_ip_mapping", "labels", ]) @@ -146,6 +149,13 @@ class EnterpriseAgentDetail(BaseModel): exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items # override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list) _items = [] if self.cluster_members: @@ -167,20 +177,13 @@ class EnterpriseAgentDetail(BaseModel): if _item: _items.append(_item.to_dict()) _dict['errorDetails'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list) + # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mapping (list) _items = [] - if self.interface_ip_mappings: - for _item in self.interface_ip_mappings: + if self.interface_ip_mapping: + for _item in self.interface_ip_mapping: if _item: _items.append(_item.to_dict()) - _dict['interfaceIpMappings'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in tests (list) - _items = [] - if self.tests: - for _item in self.tests: - if _item: - _items.append(_item.to_dict()) - _dict['tests'] = _items + _dict['interfaceIpMapping'] = _items # override the default output from pydantic by calling `to_dict()` of each item in notification_rules (list) _items = [] if self.notification_rules: @@ -220,6 +223,8 @@ class EnterpriseAgentDetail(BaseModel): "enabled": obj.get("enabled"), "prefix": obj.get("prefix"), "verifySslCertificates": obj.get("verifySslCertificates"), + "testIds": obj.get("testIds"), + "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "clusterMembers": [ClusterMember.from_dict(_item) for _item in obj["clusterMembers"]] if obj.get("clusterMembers") is not None else None, "utilization": obj.get("utilization"), "accountGroups": [AccountGroup.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None, @@ -232,8 +237,7 @@ class EnterpriseAgentDetail(BaseModel): "createdDate": obj.get("createdDate"), "targetForTests": obj.get("targetForTests"), "localResolutionPrefixes": obj.get("localResolutionPrefixes"), - "interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMappings"]] if obj.get("interfaceIpMappings") is not None else None, - "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, + "interfaceIpMapping": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMapping"]] if obj.get("interfaceIpMapping") is not None else None, "notificationRules": [NotificationRules.from_dict(_item) for _item in obj["notificationRules"]] if obj.get("notificationRules") is not None else None, "labels": [AgentLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "agentType": obj.get("agentType"), diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_response_expands.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_response_expands.py index 6a5deef6..8ef321e1 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_response_expands.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/enterprise_agent_response_expands.py @@ -16,7 +16,7 @@ import pprint import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field +from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional from thousandeyes_sdk.agents.models.agent_label import AgentLabel from thousandeyes_sdk.agents.models.notification_rules import NotificationRules @@ -28,10 +28,11 @@ class EnterpriseAgentResponseExpands(BaseModel): """ EnterpriseAgentResponseExpands """ # noqa: E501 + test_ids: Optional[List[StrictInt]] = Field(default=None, description="List of test IDs assigned to the agent.", alias="testIds") tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") notification_rules: Optional[List[NotificationRules]] = Field(default=None, description="List of notification rule objects configured on agent", alias="notificationRules") labels: Optional[List[AgentLabel]] = Field(default=None, description="List of labels. See `/labels` for more information.") - __properties: ClassVar[List[str]] = ["tests", "notificationRules", "labels"] + __properties: ClassVar[List[str]] = ["testIds", "tests", "notificationRules", "labels"] model_config = ConfigDict( populate_by_name=True, @@ -65,8 +66,10 @@ class EnterpriseAgentResponseExpands(BaseModel): 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([ + "test_ids", "labels", ]) @@ -108,6 +111,7 @@ class EnterpriseAgentResponseExpands(BaseModel): return cls.model_validate(obj) _obj = cls.model_validate({ + "testIds": obj.get("testIds"), "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "notificationRules": [NotificationRules.from_dict(_item) for _item in obj["notificationRules"]] if obj.get("notificationRules") is not None else None, "labels": [AgentLabel.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None diff --git a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/simple_enterprise_agent.py b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/simple_enterprise_agent.py index 7232e06a..4e94b1ec 100644 --- a/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/simple_enterprise_agent.py +++ b/thousandeyes-sdk-agents/src/thousandeyes_sdk/agents/models/simple_enterprise_agent.py @@ -25,6 +25,7 @@ from thousandeyes_sdk.agents.models.enterprise_agent_ipv6_policy import Enterpri from thousandeyes_sdk.agents.models.enterprise_agent_state import EnterpriseAgentState from thousandeyes_sdk.agents.models.error_detail import ErrorDetail from thousandeyes_sdk.agents.models.interface_ip_mapping import InterfaceIpMapping +from thousandeyes_sdk.agents.models.simple_test import SimpleTest from typing import Optional, Set from typing_extensions import Self @@ -42,6 +43,8 @@ class SimpleEnterpriseAgent(BaseModel): enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.") prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.") verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates") + test_ids: Optional[List[StrictInt]] = Field(default=None, description="List of test IDs assigned to the agent.", alias="testIds") + tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.") cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers") utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).") account_groups: Optional[List[AccountGroup]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups") @@ -54,8 +57,8 @@ class SimpleEnterpriseAgent(BaseModel): created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate") target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests") local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes") - interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings") - __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings"] + interface_ip_mapping: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMapping") + __properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "location", "countryId", "enabled", "prefix", "verifySslCertificates", "testIds", "tests", "clusterMembers", "utilization", "accountGroups", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMapping"] model_config = ConfigDict( populate_by_name=True, @@ -103,6 +106,7 @@ class SimpleEnterpriseAgent(BaseModel): * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. """ excluded_fields: Set[str] = set([ "ip_addresses", @@ -113,13 +117,14 @@ class SimpleEnterpriseAgent(BaseModel): "country_id", "prefix", "verify_ssl_certificates", + "test_ids", "cluster_members", "utilization", "error_details", "hostname", "last_seen", "created_date", - "interface_ip_mappings", + "interface_ip_mapping", ]) _dict = self.model_dump( @@ -127,6 +132,13 @@ class SimpleEnterpriseAgent(BaseModel): exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items # override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list) _items = [] if self.cluster_members: @@ -148,13 +160,13 @@ class SimpleEnterpriseAgent(BaseModel): if _item: _items.append(_item.to_dict()) _dict['errorDetails'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list) + # override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mapping (list) _items = [] - if self.interface_ip_mappings: - for _item in self.interface_ip_mappings: + if self.interface_ip_mapping: + for _item in self.interface_ip_mapping: if _item: _items.append(_item.to_dict()) - _dict['interfaceIpMappings'] = _items + _dict['interfaceIpMapping'] = _items return _dict @classmethod @@ -177,6 +189,8 @@ class SimpleEnterpriseAgent(BaseModel): "enabled": obj.get("enabled"), "prefix": obj.get("prefix"), "verifySslCertificates": obj.get("verifySslCertificates"), + "testIds": obj.get("testIds"), + "tests": [SimpleTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None, "clusterMembers": [ClusterMember.from_dict(_item) for _item in obj["clusterMembers"]] if obj.get("clusterMembers") is not None else None, "utilization": obj.get("utilization"), "accountGroups": [AccountGroup.from_dict(_item) for _item in obj["accountGroups"]] if obj.get("accountGroups") is not None else None, @@ -189,7 +203,7 @@ class SimpleEnterpriseAgent(BaseModel): "createdDate": obj.get("createdDate"), "targetForTests": obj.get("targetForTests"), "localResolutionPrefixes": obj.get("localResolutionPrefixes"), - "interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMappings"]] if obj.get("interfaceIpMappings") is not None else None + "interfaceIpMapping": [InterfaceIpMapping.from_dict(_item) for _item in obj["interfaceIpMapping"]] if obj.get("interfaceIpMapping") is not None else None }) return _obj diff --git a/thousandeyes-sdk-agents/test/test_tests_assignment_on_agents_api.py b/thousandeyes-sdk-agents/test/test_tests_assignment_on_agents_api.py new file mode 100644 index 00000000..5d9796cc --- /dev/null +++ b/thousandeyes-sdk-agents/test/test_tests_assignment_on_agents_api.py @@ -0,0 +1,369 @@ +# coding: utf-8 + +""" + Agents API + + ## Overview Manage Cloud and Enterprise Agents available to your account in ThousandEyes. + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.agents.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.agents.api.tests_assignment_on_agents_api import TestsAssignmentOnAgentsApi + + +class TestTestsAssignmentOnAgentsApi(unittest.TestCase): + """TestsAssignmentOnAgentsApi unit test stubs""" + + def setUp(self) -> None: + self.api = TestsAssignmentOnAgentsApi() + + def tearDown(self) -> None: + pass + + def test_assign_tests_models_validation(self) -> None: + """Test case for assign_tests request and response models""" + request_body_json = """ + { + "testIds" : [ "281474976710706" ] + }""" + + request_loaded_json = json.loads(request_body_json) + 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", + "agentType" : "cloud", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "labels" : [ { + "labelId" : "11", + "name" : "Label name" + }, { + "labelId" : "11", + "name" : "Label name" + } ], + "tests" : [ { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + } ], + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "verifySslCertificates" : true + }""" + + 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""" + request_body_json = """ + { + "testIds" : [ "281474976710706" ] + }""" + + request_loaded_json = json.loads(request_body_json) + 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", + "agentType" : "cloud", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "labels" : [ { + "labelId" : "11", + "name" : "Label name" + }, { + "labelId" : "11", + "name" : "Label name" + } ], + "tests" : [ { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + } ], + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "verifySslCertificates" : true + }""" + + 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""" + request_body_json = """ + { + "testIds" : [ "281474976710706" ] + }""" + + request_loaded_json = json.loads(request_body_json) + 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", + "agentType" : "cloud", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "prefix" : "99.128.0.0/11", + "agentName" : "thousandeyes-stg-va-254", + "countryId" : "US", + "enabled" : true, + "network" : "AT&T Services, Inc. (AS 7018)", + "labels" : [ { + "labelId" : "11", + "name" : "Label name" + }, { + "labelId" : "11", + "name" : "Label name" + } ], + "tests" : [ { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + }, { + "_links" : { + "testResults" : [ { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/network" + }, { + "href" : "https://api.thousandeyes.com/v7/test-results/281474976710706/path-vis" + } ], + "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" + } + }, + "liveShare" : false, + "savedEvent" : true, + "description" : "ThousandEyes Test", + "type" : "agent-to-server", + "enabled" : true, + "createdDate" : "2022-07-17T22:00:54Z", + "createdBy" : "user@user.com", + "modifiedDate" : "2022-07-17T22:00:54Z", + "interval" : 60, + "modifiedBy" : "user@user.com", + "testId" : "281474976710706", + "alertsEnabled" : true, + "testName" : "ThousandEyes Test" + } ], + "publicIpAddresses" : [ "192.168.1.78", "f9b2:3a21:f25c:d300:03f4:586d:f8d6:4e1c" ], + "ipAddresses" : [ "99.139.65.220", "9bbd:8a0a:a257:5876:288b:6cb2:3f36:64ce" ], + "location" : "San Francisco Bay Area", + "verifySslCertificates" : true + }""" + + 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__': + unittest.main() diff --git a/thousandeyes-sdk-alerts/README.md b/thousandeyes-sdk-alerts/README.md index 68450838..b33adc29 100644 --- a/thousandeyes-sdk-alerts/README.md +++ b/thousandeyes-sdk-alerts/README.md @@ -12,7 +12,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.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-bgp-monitors/README.md b/thousandeyes-sdk-bgp-monitors/README.md index b331cce4..cae77ca0 100644 --- a/thousandeyes-sdk-bgp-monitors/README.md +++ b/thousandeyes-sdk-bgp-monitors/README.md @@ -9,7 +9,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.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-credentials/README.md b/thousandeyes-sdk-credentials/README.md index 88ad7f24..2a6e6cfd 100644 --- a/thousandeyes-sdk-credentials/README.md +++ b/thousandeyes-sdk-credentials/README.md @@ -13,7 +13,7 @@ For more information about credentials, see [Working With Secure Credentials](ht This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-dashboards/README.md b/thousandeyes-sdk-dashboards/README.md index e6c43f82..d45d3d53 100644 --- a/thousandeyes-sdk-dashboards/README.md +++ b/thousandeyes-sdk-dashboards/README.md @@ -3,7 +3,7 @@ Manage ThousandEyes Dashboards. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/agent_status_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/agent_status_datasource.py index 8f47e713..4e1ba08b 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/agent_status_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/agent_status_datasource.py @@ -39,6 +39,7 @@ class AgentStatusDatasource(str, Enum): INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' APPDYNAMICS_SERVICE_HEALTH = 'APPDYNAMICS_SERVICE_HEALTH' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/alert_list_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/alert_list_datasource.py index 0f130631..30cdfda9 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/alert_list_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/alert_list_datasource.py @@ -39,6 +39,7 @@ class AlertListDatasource(str, Enum): INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' APPDYNAMICS_SERVICE_HEALTH = 'APPDYNAMICS_SERVICE_HEALTH' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/api_aggregate_property.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/api_aggregate_property.py index 76ff5024..662532ec 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/api_aggregate_property.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/api_aggregate_property.py @@ -113,6 +113,11 @@ class ApiAggregateProperty(str, Enum): CLOUD_NATIVE_MONITORING_MINUS_REMOTE_SUBNET = 'CLOUD_NATIVE_MONITORING-REMOTE_SUBNET' CLOUD_NATIVE_MONITORING_MINUS_REMOTE_TYPE = 'CLOUD_NATIVE_MONITORING-REMOTE_TYPE' CLOUD_NATIVE_MONITORING_MINUS_REMOTE_SERVICE_PROVIDER = 'CLOUD_NATIVE_MONITORING-REMOTE_SERVICE_PROVIDER' + TRAFFIC_INSIGHTS_MONITORING_MINUS_ALL = 'TRAFFIC_INSIGHTS_MONITORING-ALL' + TRAFFIC_INSIGHTS_MONITORING_MINUS_GEOLOC = 'TRAFFIC_INSIGHTS_MONITORING-GEOLOC' + TRAFFIC_INSIGHTS_MONITORING_MINUS_DEVICE = 'TRAFFIC_INSIGHTS_MONITORING-DEVICE' + TRAFFIC_INSIGHTS_MONITORING_MINUS_DEVICE_IFNAME = 'TRAFFIC_INSIGHTS_MONITORING-DEVICE_IFNAME' + TRAFFIC_INSIGHTS_MONITORING_MINUS_APPLICATION = 'TRAFFIC_INSIGHTS_MONITORING-APPLICATION' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/box_and_whiskers_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/box_and_whiskers_datasource.py index 1c472617..a71705a2 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/box_and_whiskers_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/box_and_whiskers_datasource.py @@ -37,6 +37,7 @@ class BoxAndWhiskersDatasource(str, Enum): INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' ROUTING = 'ROUTING' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/color_grid_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/color_grid_datasource.py index 3ce67c6f..7645c042 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/color_grid_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/color_grid_datasource.py @@ -38,6 +38,7 @@ class ColorGridDatasource(str, Enum): INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' ROUTING = 'ROUTING' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/dashboard_metric.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/dashboard_metric.py index 6c25ce8c..0651ff87 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/dashboard_metric.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/dashboard_metric.py @@ -263,6 +263,10 @@ class DashboardMetric(str, Enum): CLOUD_NATIVE_MONITORING_MINUS_ALL_EVENTS = 'CLOUD_NATIVE_MONITORING-ALL_EVENTS' CLOUD_NATIVE_MONITORING_MINUS_CONFIGURATION_CHANGE_EVENTS = 'CLOUD_NATIVE_MONITORING-CONFIGURATION_CHANGE_EVENTS' CLOUD_NATIVE_MONITORING_MINUS_AUTOSCALING_EVENTS = 'CLOUD_NATIVE_MONITORING-AUTOSCALING_EVENTS' + TRAFFIC_INSIGHTS_MONITORING_MINUS_TOTAL_THROUGHPUT = 'TRAFFIC_INSIGHTS_MONITORING-TOTAL_THROUGHPUT' + TRAFFIC_INSIGHTS_MONITORING_MINUS_DOWNSTREAM_THROUGHPUT = 'TRAFFIC_INSIGHTS_MONITORING-DOWNSTREAM_THROUGHPUT' + TRAFFIC_INSIGHTS_MONITORING_MINUS_UPSTREAM_THROUGHPUT = 'TRAFFIC_INSIGHTS_MONITORING-UPSTREAM_THROUGHPUT' + TRAFFIC_INSIGHTS_MONITORING_MINUS_CONNECTION_RATE = 'TRAFFIC_INSIGHTS_MONITORING-CONNECTION_RATE' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/geo_map_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/geo_map_datasource.py index 77e561e0..6268df72 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/geo_map_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/geo_map_datasource.py @@ -36,6 +36,7 @@ class GeoMapDatasource(str, Enum): INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' ROUTING = 'ROUTING' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/grouped_bar_chart_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/grouped_bar_chart_datasource.py index 5907e642..acd73933 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/grouped_bar_chart_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/grouped_bar_chart_datasource.py @@ -37,6 +37,7 @@ class GroupedBarChartDatasource(str, Enum): INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' ROUTING = 'ROUTING' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/metric_group.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/metric_group.py index 24c8f051..c31e65a2 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/metric_group.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/metric_group.py @@ -63,6 +63,7 @@ class MetricGroup(str, Enum): APPDYNAMICS_SERVICE_HEALTH = 'APPDYNAMICS_SERVICE_HEALTH' CLOUD_NATIVE_MONITORING_MINUS_TRAFFIC_FLOW = 'CLOUD_NATIVE_MONITORING-TRAFFIC_FLOW' CLOUD_NATIVE_MONITORING_MINUS_EVENTS = 'CLOUD_NATIVE_MONITORING-EVENTS' + TRAFFIC_INSIGHTS_MONITORING_MINUS_TRAFFIC_FLOW = 'TRAFFIC_INSIGHTS_MONITORING-TRAFFIC_FLOW' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/multi_metrics_table_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/multi_metrics_table_datasource.py index 17b88c64..1a960e76 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/multi_metrics_table_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/multi_metrics_table_datasource.py @@ -37,6 +37,7 @@ class MultiMetricsTableDatasource(str, Enum): INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' ROUTING = 'ROUTING' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/numbers_card_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/numbers_card_datasource.py index 9ad27306..decbe7a8 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/numbers_card_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/numbers_card_datasource.py @@ -37,6 +37,7 @@ class NumbersCardDatasource(str, Enum): INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' ROUTING = 'ROUTING' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/pie_chart_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/pie_chart_datasource.py index 09760494..c49b778c 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/pie_chart_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/pie_chart_datasource.py @@ -30,6 +30,7 @@ class PieChartDatasource(str, Enum): ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/stacked_area_chart_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/stacked_area_chart_datasource.py index 61d94eb2..2f095e08 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/stacked_area_chart_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/stacked_area_chart_datasource.py @@ -30,6 +30,7 @@ class StackedAreaChartDatasource(str, Enum): ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/stacked_bar_chart_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/stacked_bar_chart_datasource.py index d7c5e626..39f0e904 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/stacked_bar_chart_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/stacked_bar_chart_datasource.py @@ -30,6 +30,7 @@ class StackedBarChartDatasource(str, Enum): ENDPOINT_BROWSER_SESSION = 'ENDPOINT_BROWSER_SESSION' ENDPOINT_SCHEDULED_TEST = 'ENDPOINT_SCHEDULED_TEST' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/table_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/table_datasource.py index a2f63bfd..32e01379 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/table_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/table_datasource.py @@ -37,6 +37,7 @@ class TableDatasource(str, Enum): INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' ROUTING = 'ROUTING' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/test_table_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/test_table_datasource.py index 87593e3a..b39aed74 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/test_table_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/test_table_datasource.py @@ -39,6 +39,7 @@ class TestTableDatasource(str, Enum): INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' APPDYNAMICS_SERVICE_HEALTH = 'APPDYNAMICS_SERVICE_HEALTH' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/timeseries_datasource.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/timeseries_datasource.py index 5dacebef..a6b8b45b 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/timeseries_datasource.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/timeseries_datasource.py @@ -37,6 +37,7 @@ class TimeseriesDatasource(str, Enum): INTERNET_INSIGHTS = 'INTERNET_INSIGHTS' ROUTING = 'ROUTING' CLOUD_NATIVE_MONITORING = 'CLOUD_NATIVE_MONITORING' + TRAFFIC_INSIGHTS_MONITORING = 'TRAFFIC_INSIGHTS_MONITORING' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/widget_measure_type.py b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/widget_measure_type.py index c4f3aceb..466cb04a 100644 --- a/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/widget_measure_type.py +++ b/thousandeyes-sdk-dashboards/src/thousandeyes_sdk/dashboards/models/widget_measure_type.py @@ -38,6 +38,8 @@ class WidgetMeasureType(str, Enum): SUM = 'SUM' CLOUD_NATIVE_MONITORING_MINUS_MEAN = 'CLOUD_NATIVE_MONITORING-MEAN' CLOUD_NATIVE_MONITORING_MINUS_SUM = 'CLOUD_NATIVE_MONITORING-SUM' + TRAFFIC_INSIGHTS_MONITORING_MINUS_SUM = 'TRAFFIC_INSIGHTS_MONITORING-SUM' + TRAFFIC_INSIGHTS_MONITORING_MINUS_MEAN = 'TRAFFIC_INSIGHTS_MONITORING-MEAN' UNKNOWN = 'unknown' @classmethod diff --git a/thousandeyes-sdk-emulation/README.md b/thousandeyes-sdk-emulation/README.md index 13d8dee3..3f47da2e 100644 --- a/thousandeyes-sdk-emulation/README.md +++ b/thousandeyes-sdk-emulation/README.md @@ -9,7 +9,7 @@ To access Emulation API operations, the following permissions are required: This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-endpoint-agents/README.md b/thousandeyes-sdk-endpoint-agents/README.md index 3c48a373..b5e79d01 100644 --- a/thousandeyes-sdk-endpoint-agents/README.md +++ b/thousandeyes-sdk-endpoint-agents/README.md @@ -5,7 +5,7 @@ For more information about Endpoint Agents, see [Endpoint Agents](https://docs.t This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-endpoint-instant-tests/README.md b/thousandeyes-sdk-endpoint-instant-tests/README.md index 9623b35f..ea6e0df4 100644 --- a/thousandeyes-sdk-endpoint-instant-tests/README.md +++ b/thousandeyes-sdk-endpoint-instant-tests/README.md @@ -13,7 +13,7 @@ The URLs for these API test data endpoints are provided within the test definiti This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-endpoint-labels/README.md b/thousandeyes-sdk-endpoint-labels/README.md index 98d9ed4b..6e826b07 100644 --- a/thousandeyes-sdk-endpoint-labels/README.md +++ b/thousandeyes-sdk-endpoint-labels/README.md @@ -4,7 +4,7 @@ Manage labels applied to endpoint agents using this API. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-endpoint-test-results/README.md b/thousandeyes-sdk-endpoint-test-results/README.md index 75cb8bd9..42ad8743 100644 --- a/thousandeyes-sdk-endpoint-test-results/README.md +++ b/thousandeyes-sdk-endpoint-test-results/README.md @@ -3,7 +3,7 @@ Retrieve results for scheduled and dynamic tests on endpoint agents. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-endpoint-tests/README.md b/thousandeyes-sdk-endpoint-tests/README.md index e302806d..1aeab091 100644 --- a/thousandeyes-sdk-endpoint-tests/README.md +++ b/thousandeyes-sdk-endpoint-tests/README.md @@ -5,7 +5,7 @@ Manage endpoint agent dynamic and scheduled tests using the Endpoint Tests API. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-event-detection/README.md b/thousandeyes-sdk-event-detection/README.md index 019a3d9a..74c4125f 100644 --- a/thousandeyes-sdk-event-detection/README.md +++ b/thousandeyes-sdk-event-detection/README.md @@ -12,7 +12,7 @@ With the Events API, you can perform the following tasks on the ThousandEyes pla This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-instant-tests/README.md b/thousandeyes-sdk-instant-tests/README.md index 3e078ec9..1858ff10 100644 --- a/thousandeyes-sdk-instant-tests/README.md +++ b/thousandeyes-sdk-instant-tests/README.md @@ -6,7 +6,7 @@ The response does not include the immediate test results. Use the Test Results e This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-internet-insights/README.md b/thousandeyes-sdk-internet-insights/README.md index 70dc19b7..eb6e75d9 100644 --- a/thousandeyes-sdk-internet-insights/README.md +++ b/thousandeyes-sdk-internet-insights/README.md @@ -14,7 +14,7 @@ For more information about Internet Insights, see the [Internet Insights](https: This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-snapshots/README.md b/thousandeyes-sdk-snapshots/README.md index 3d518966..12618637 100644 --- a/thousandeyes-sdk-snapshots/README.md +++ b/thousandeyes-sdk-snapshots/README.md @@ -3,7 +3,7 @@ Creates a new test snapshot in ThousandEyes. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-streaming/.openapi-generator/FILES b/thousandeyes-sdk-streaming/.openapi-generator/FILES index 18208db3..47e72293 100644 --- a/thousandeyes-sdk-streaming/.openapi-generator/FILES +++ b/thousandeyes-sdk-streaming/.openapi-generator/FILES @@ -20,6 +20,8 @@ docs/Stream.md docs/StreamLinks.md docs/StreamResponse.md docs/StreamSelfLink.md +docs/StreamStatus.md +docs/StreamStatusType.md docs/StreamType.md docs/StreamingApi.md docs/TagMatch.md @@ -53,6 +55,8 @@ src/thousandeyes_sdk/streaming/models/stream.py src/thousandeyes_sdk/streaming/models/stream_links.py src/thousandeyes_sdk/streaming/models/stream_response.py src/thousandeyes_sdk/streaming/models/stream_self_link.py +src/thousandeyes_sdk/streaming/models/stream_status.py +src/thousandeyes_sdk/streaming/models/stream_status_type.py src/thousandeyes_sdk/streaming/models/stream_type.py src/thousandeyes_sdk/streaming/models/tag_match.py src/thousandeyes_sdk/streaming/models/tag_match_object_type.py diff --git a/thousandeyes-sdk-streaming/README.md b/thousandeyes-sdk-streaming/README.md index 9979d719..b15a9052 100644 --- a/thousandeyes-sdk-streaming/README.md +++ b/thousandeyes-sdk-streaming/README.md @@ -15,7 +15,7 @@ For more information about ThousandEyes for OpenTelemetry, see the [documentatio This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator @@ -135,6 +135,8 @@ Class | Method | HTTP request | Description - [StreamLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/StreamLinks.md) - [StreamResponse](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/StreamResponse.md) - [StreamSelfLink](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/StreamSelfLink.md) + - [StreamStatus](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/StreamStatus.md) + - [StreamStatusType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/StreamStatusType.md) - [StreamType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/StreamType.md) - [TagMatch](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/TagMatch.md) - [TagMatchObjectType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-streaming/docs/TagMatchObjectType.md) diff --git a/thousandeyes-sdk-streaming/docs/CreateStreamResponse.md b/thousandeyes-sdk-streaming/docs/CreateStreamResponse.md index 877464be..adf13ea1 100644 --- a/thousandeyes-sdk-streaming/docs/CreateStreamResponse.md +++ b/thousandeyes-sdk-streaming/docs/CreateStreamResponse.md @@ -19,6 +19,7 @@ Name | Type | Description | Notes **filters** | [**Filters**](Filters.md) | | [optional] **exporter_config** | [**ExporterConfig**](ExporterConfig.md) | | [optional] **audit_operation** | [**AuditOperation**](AuditOperation.md) | | [optional] +**stream_status** | [**StreamStatus**](StreamStatus.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-streaming/docs/GetStreamResponse.md b/thousandeyes-sdk-streaming/docs/GetStreamResponse.md index 52d3b3a1..002224ee 100644 --- a/thousandeyes-sdk-streaming/docs/GetStreamResponse.md +++ b/thousandeyes-sdk-streaming/docs/GetStreamResponse.md @@ -19,6 +19,7 @@ Name | Type | Description | Notes **filters** | [**Filters**](Filters.md) | | [optional] **exporter_config** | [**ExporterConfig**](ExporterConfig.md) | | [optional] **audit_operation** | [**AuditOperationWithUpdate**](AuditOperationWithUpdate.md) | | [optional] +**stream_status** | [**StreamStatus**](StreamStatus.md) | | [optional] ## Example diff --git a/thousandeyes-sdk-streaming/docs/StreamStatus.md b/thousandeyes-sdk-streaming/docs/StreamStatus.md new file mode 100644 index 00000000..9d1157a5 --- /dev/null +++ b/thousandeyes-sdk-streaming/docs/StreamStatus.md @@ -0,0 +1,31 @@ +# StreamStatus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last_success** | **int** | Last timestamp when data was successfully sent to the stream endpoint. | [optional] +**last_failure** | **int** | Last timestamp when data failed to send the stream endpoint. | [optional] +**status** | [**StreamStatusType**](StreamStatusType.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.streaming.models.stream_status import StreamStatus + +# TODO update the JSON string below +json = "{}" +# create an instance of StreamStatus from a JSON string +stream_status_instance = StreamStatus.from_json(json) +# print the JSON string representation of the object +print(StreamStatus.to_json()) + +# convert the object into a dict +stream_status_dict = stream_status_instance.to_dict() +# create an instance of StreamStatus from a dict +stream_status_from_dict = StreamStatus.from_dict(stream_status_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-streaming/docs/StreamStatusType.md b/thousandeyes-sdk-streaming/docs/StreamStatusType.md new file mode 100644 index 00000000..55aa17b1 --- /dev/null +++ b/thousandeyes-sdk-streaming/docs/StreamStatusType.md @@ -0,0 +1,12 @@ +# StreamStatusType + +The status of the stream integration. pending: No data is currently being sent to the stream endpoint. failing: Data is being sent but not successfully reaching the stream endpoint. connected: Data is being sent successfully to the stream endpoint. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/__init__.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/__init__.py index 8d21fc62..8841d661 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/__init__.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/__init__.py @@ -37,6 +37,8 @@ from thousandeyes_sdk.streaming.models.stream import Stream from thousandeyes_sdk.streaming.models.stream_links import StreamLinks from thousandeyes_sdk.streaming.models.stream_response import StreamResponse from thousandeyes_sdk.streaming.models.stream_self_link import StreamSelfLink +from thousandeyes_sdk.streaming.models.stream_status import StreamStatus +from thousandeyes_sdk.streaming.models.stream_status_type import StreamStatusType from thousandeyes_sdk.streaming.models.stream_type import StreamType from thousandeyes_sdk.streaming.models.tag_match import TagMatch from thousandeyes_sdk.streaming.models.tag_match_object_type import TagMatchObjectType diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/__init__.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/__init__.py index 4190961a..30a6a2a0 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/__init__.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/__init__.py @@ -32,6 +32,8 @@ from thousandeyes_sdk.streaming.models.stream import Stream from thousandeyes_sdk.streaming.models.stream_links import StreamLinks from thousandeyes_sdk.streaming.models.stream_response import StreamResponse from thousandeyes_sdk.streaming.models.stream_self_link import StreamSelfLink +from thousandeyes_sdk.streaming.models.stream_status import StreamStatus +from thousandeyes_sdk.streaming.models.stream_status_type import StreamStatusType from thousandeyes_sdk.streaming.models.stream_type import StreamType from thousandeyes_sdk.streaming.models.tag_match import TagMatch from thousandeyes_sdk.streaming.models.tag_match_object_type import TagMatchObjectType diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/create_stream_response.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/create_stream_response.py index a73b661e..84ccc06e 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/create_stream_response.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/create_stream_response.py @@ -25,6 +25,7 @@ from thousandeyes_sdk.streaming.models.exporter_config import ExporterConfig from thousandeyes_sdk.streaming.models.filters import Filters from thousandeyes_sdk.streaming.models.signal import Signal from thousandeyes_sdk.streaming.models.stream_links import StreamLinks +from thousandeyes_sdk.streaming.models.stream_status import StreamStatus from thousandeyes_sdk.streaming.models.stream_type import StreamType from thousandeyes_sdk.streaming.models.tag_match import TagMatch from thousandeyes_sdk.streaming.models.test_match import TestMatch @@ -49,7 +50,8 @@ class CreateStreamResponse(BaseModel): filters: Optional[Filters] = None exporter_config: Optional[ExporterConfig] = Field(default=None, alias="exporterConfig") audit_operation: Optional[AuditOperation] = Field(default=None, alias="auditOperation") - __properties: ClassVar[List[str]] = ["id", "enabled", "_links", "type", "signal", "endpointType", "streamEndpointUrl", "dataModelVersion", "customHeaders", "tagMatch", "testMatch", "filters", "exporterConfig", "auditOperation"] + stream_status: Optional[StreamStatus] = Field(default=None, alias="streamStatus") + __properties: ClassVar[List[str]] = ["id", "enabled", "_links", "type", "signal", "endpointType", "streamEndpointUrl", "dataModelVersion", "customHeaders", "tagMatch", "testMatch", "filters", "exporterConfig", "auditOperation", "streamStatus"] model_config = ConfigDict( populate_by_name=True, @@ -119,6 +121,9 @@ class CreateStreamResponse(BaseModel): # override the default output from pydantic by calling `to_dict()` of audit_operation if self.audit_operation: _dict['auditOperation'] = self.audit_operation.to_dict() + # override the default output from pydantic by calling `to_dict()` of stream_status + if self.stream_status: + _dict['streamStatus'] = self.stream_status.to_dict() return _dict @classmethod @@ -144,7 +149,8 @@ class CreateStreamResponse(BaseModel): "testMatch": [TestMatch.from_dict(_item) for _item in obj["testMatch"]] if obj.get("testMatch") is not None else None, "filters": Filters.from_dict(obj["filters"]) if obj.get("filters") is not None else None, "exporterConfig": ExporterConfig.from_dict(obj["exporterConfig"]) if obj.get("exporterConfig") is not None else None, - "auditOperation": AuditOperation.from_dict(obj["auditOperation"]) if obj.get("auditOperation") is not None else None + "auditOperation": AuditOperation.from_dict(obj["auditOperation"]) if obj.get("auditOperation") is not None else None, + "streamStatus": StreamStatus.from_dict(obj["streamStatus"]) if obj.get("streamStatus") is not None else None }) return _obj diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/get_stream_response.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/get_stream_response.py index 7f64a1c8..5a3d8f15 100644 --- a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/get_stream_response.py +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/get_stream_response.py @@ -25,6 +25,7 @@ from thousandeyes_sdk.streaming.models.exporter_config import ExporterConfig from thousandeyes_sdk.streaming.models.filters import Filters from thousandeyes_sdk.streaming.models.signal import Signal from thousandeyes_sdk.streaming.models.stream_links import StreamLinks +from thousandeyes_sdk.streaming.models.stream_status import StreamStatus from thousandeyes_sdk.streaming.models.stream_type import StreamType from thousandeyes_sdk.streaming.models.tag_match import TagMatch from thousandeyes_sdk.streaming.models.test_match import TestMatch @@ -49,7 +50,8 @@ class GetStreamResponse(BaseModel): filters: Optional[Filters] = None exporter_config: Optional[ExporterConfig] = Field(default=None, alias="exporterConfig") audit_operation: Optional[AuditOperationWithUpdate] = Field(default=None, alias="auditOperation") - __properties: ClassVar[List[str]] = ["id", "enabled", "_links", "type", "signal", "endpointType", "streamEndpointUrl", "dataModelVersion", "customHeaders", "tagMatch", "testMatch", "filters", "exporterConfig", "auditOperation"] + stream_status: Optional[StreamStatus] = Field(default=None, alias="streamStatus") + __properties: ClassVar[List[str]] = ["id", "enabled", "_links", "type", "signal", "endpointType", "streamEndpointUrl", "dataModelVersion", "customHeaders", "tagMatch", "testMatch", "filters", "exporterConfig", "auditOperation", "streamStatus"] model_config = ConfigDict( populate_by_name=True, @@ -119,6 +121,9 @@ class GetStreamResponse(BaseModel): # override the default output from pydantic by calling `to_dict()` of audit_operation if self.audit_operation: _dict['auditOperation'] = self.audit_operation.to_dict() + # override the default output from pydantic by calling `to_dict()` of stream_status + if self.stream_status: + _dict['streamStatus'] = self.stream_status.to_dict() return _dict @classmethod @@ -144,7 +149,8 @@ class GetStreamResponse(BaseModel): "testMatch": [TestMatch.from_dict(_item) for _item in obj["testMatch"]] if obj.get("testMatch") is not None else None, "filters": Filters.from_dict(obj["filters"]) if obj.get("filters") is not None else None, "exporterConfig": ExporterConfig.from_dict(obj["exporterConfig"]) if obj.get("exporterConfig") is not None else None, - "auditOperation": AuditOperationWithUpdate.from_dict(obj["auditOperation"]) if obj.get("auditOperation") is not None else None + "auditOperation": AuditOperationWithUpdate.from_dict(obj["auditOperation"]) if obj.get("auditOperation") is not None else None, + "streamStatus": StreamStatus.from_dict(obj["streamStatus"]) if obj.get("streamStatus") is not None else None }) return _obj diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/stream_status.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/stream_status.py new file mode 100644 index 00000000..0aaf794f --- /dev/null +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/stream_status.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry API + + ThousandEyes for OpenTelemetry provides machine-to-machine integration between ThousandEyes and its customers. It allows you to export ThousandEyes telemetry data in OTel format, which is widely used in the industry. With ThousandEyes for OTel, you can leverage frameworks widely used in the observability domain - such as Splunk, Grafana, and Honeycomb - to capture and analyze ThousandEyes data. Any client that supports OTel can use ThousandEyes for OpenTelemetry. ThousandEyes for OTel is made up of the following components: * Data streaming APIs that you can use to configure and enable your ThousandEyes tests with OTel-compatible streams, in particular to configure how ThousandEyes telemetry data is exported to client integrations. * A set of streaming pipelines called _collectors_ that actively fetch ThousandEyes network test data, enrich the data with some additional detail, filter, and push the data to the customer-configured endpoints, depending on what you configure via the public APIs. * Third-party OTel collectors that receive, transform, filter, and export different metrics to client applications such as AppD, or any other OTel-capable client configuration. For more information about ThousandEyes for OpenTelemetry, see the [documentation](https://docs.thousandeyes.com/product-documentation/api/opentelemetry). + + Generated by OpenAPI Generator (https://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 +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.streaming.models.stream_status_type import StreamStatusType +from typing import Optional, Set +from typing_extensions import Self + +class StreamStatus(BaseModel): + """ + StreamStatus + """ # noqa: E501 + last_success: Optional[StrictInt] = Field(default=None, description="Last timestamp when data was successfully sent to the stream endpoint.", alias="lastSuccess") + last_failure: Optional[StrictInt] = Field(default=None, description="Last timestamp when data failed to send the stream endpoint.", alias="lastFailure") + status: Optional[StreamStatusType] = None + __properties: ClassVar[List[str]] = ["lastSuccess", "lastFailure", "status"] + + 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 StreamStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + # set to None if last_success (nullable) is None + # and model_fields_set contains the field + if self.last_success is None and "last_success" in self.model_fields_set: + _dict['lastSuccess'] = None + + # set to None if last_failure (nullable) is None + # and model_fields_set contains the field + if self.last_failure is None and "last_failure" in self.model_fields_set: + _dict['lastFailure'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StreamStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "lastSuccess": obj.get("lastSuccess"), + "lastFailure": obj.get("lastFailure"), + "status": obj.get("status") + }) + return _obj + + diff --git a/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/stream_status_type.py b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/stream_status_type.py new file mode 100644 index 00000000..eb777408 --- /dev/null +++ b/thousandeyes-sdk-streaming/src/thousandeyes_sdk/streaming/models/stream_status_type.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + ThousandEyes for OpenTelemetry API + + ThousandEyes for OpenTelemetry provides machine-to-machine integration between ThousandEyes and its customers. It allows you to export ThousandEyes telemetry data in OTel format, which is widely used in the industry. With ThousandEyes for OTel, you can leverage frameworks widely used in the observability domain - such as Splunk, Grafana, and Honeycomb - to capture and analyze ThousandEyes data. Any client that supports OTel can use ThousandEyes for OpenTelemetry. ThousandEyes for OTel is made up of the following components: * Data streaming APIs that you can use to configure and enable your ThousandEyes tests with OTel-compatible streams, in particular to configure how ThousandEyes telemetry data is exported to client integrations. * A set of streaming pipelines called _collectors_ that actively fetch ThousandEyes network test data, enrich the data with some additional detail, filter, and push the data to the customer-configured endpoints, depending on what you configure via the public APIs. * Third-party OTel collectors that receive, transform, filter, and export different metrics to client applications such as AppD, or any other OTel-capable client configuration. For more information about ThousandEyes for OpenTelemetry, see the [documentation](https://docs.thousandeyes.com/product-documentation/api/opentelemetry). + + 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 StreamStatusType(str, Enum): + """ + The status of the stream integration. pending: No data is currently being sent to the stream endpoint. failing: Data is being sent but not successfully reaching the stream endpoint. connected: Data is being sent successfully to the stream endpoint. + """ + + """ + allowed enum values + """ + CONNECTED = 'connected' + PENDING = 'pending' + FAILING = 'failing' + UNKNOWN = 'unknown' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of StreamStatusType from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + """Handle unknown values""" + return cls.UNKNOWN + diff --git a/thousandeyes-sdk-streaming/test/test_streaming_api.py b/thousandeyes-sdk-streaming/test/test_streaming_api.py index 5901bd57..3d4f669b 100644 --- a/thousandeyes-sdk-streaming/test/test_streaming_api.py +++ b/thousandeyes-sdk-streaming/test/test_streaming_api.py @@ -115,6 +115,11 @@ class TestStreamingApi(unittest.TestCase): "value" : "valueB" } ], "id" : "342ieu09", + "streamStatus" : { + "lastSuccess" : 1679677853573, + "lastFailure" : 1679677853573, + "status" : "connected" + }, "signal" : "metric", "auditOperation" : { "createdDate" : 1679677853573, @@ -177,6 +182,11 @@ class TestStreamingApi(unittest.TestCase): "value" : "valueB" } ], "id" : "342ieu09", + "streamStatus" : { + "lastSuccess" : 1679677853573, + "lastFailure" : 1679677853573, + "status" : "connected" + }, "signal" : "metric", "auditOperation" : { "createdDate" : 1679677853573, @@ -237,6 +247,11 @@ class TestStreamingApi(unittest.TestCase): "value" : "valueB" } ], "id" : "342ieu09", + "streamStatus" : { + "lastSuccess" : 1679677853573, + "lastFailure" : 1679677853573, + "status" : "connected" + }, "signal" : "metric", "auditOperation" : { "createdDate" : 1679677853573, @@ -287,6 +302,11 @@ class TestStreamingApi(unittest.TestCase): "value" : "valueB" } ], "id" : "342ieu09", + "streamStatus" : { + "lastSuccess" : 1679677853573, + "lastFailure" : 1679677853573, + "status" : "connected" + }, "signal" : "metric", "auditOperation" : { "createdDate" : 1679677853573, @@ -390,6 +410,11 @@ class TestStreamingApi(unittest.TestCase): "value" : "valueB" } ], "id" : "342ieu09", + "streamStatus" : { + "lastSuccess" : 1679677853573, + "lastFailure" : 1679677853573, + "status" : "connected" + }, "signal" : "metric", "auditOperation" : { "createdDate" : 1679677853573, diff --git a/thousandeyes-sdk-tags/README.md b/thousandeyes-sdk-tags/README.md index e9caee93..fb08dc35 100644 --- a/thousandeyes-sdk-tags/README.md +++ b/thousandeyes-sdk-tags/README.md @@ -16,7 +16,7 @@ Things to note with the ThousandEyes Tags API: This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-test-results/README.md b/thousandeyes-sdk-test-results/README.md index b181a704..9cdfe28e 100644 --- a/thousandeyes-sdk-test-results/README.md +++ b/thousandeyes-sdk-test-results/README.md @@ -3,7 +3,7 @@ Get test result metrics for Network and Application Synthetics tests. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-tests/README.md b/thousandeyes-sdk-tests/README.md index 4ce96370..32fad6c5 100644 --- a/thousandeyes-sdk-tests/README.md +++ b/thousandeyes-sdk-tests/README.md @@ -4,7 +4,7 @@ This API allows you to list, create, edit, and delete Network and Application Sy This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator diff --git a/thousandeyes-sdk-tests/docs/AgentToServerTestRequest.md b/thousandeyes-sdk-tests/docs/AgentToServerTestRequest.md index 4435ba81..319d1381 100644 --- a/thousandeyes-sdk-tests/docs/AgentToServerTestRequest.md +++ b/thousandeyes-sdk-tests/docs/AgentToServerTestRequest.md @@ -41,6 +41,7 @@ Name | Type | Description | Notes **use_public_bgp** | **bool** | Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value. | [optional] [default to True] **monitors** | **List[str]** | Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint) | [optional] **agents** | [**List[TestAgentRequest]**](TestAgentRequest.md) | Contains list of Agent IDs (get `agentId` from `/agents` endpoint). | +**port** | **int** | Port number to use for the test. The default port is 80. | [optional] ## Example diff --git a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_request.py b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_request.py index 0190e131..e36c2508 100644 --- a/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_request.py +++ b/thousandeyes-sdk-tests/src/thousandeyes_sdk/tests/models/agent_to_server_test_request.py @@ -17,7 +17,7 @@ import re # noqa: F401 import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from thousandeyes_sdk.tests.models.test_agent_request import TestAgentRequest @@ -71,7 +71,8 @@ class AgentToServerTestRequest(BaseModel): use_public_bgp: Optional[StrictBool] = Field(default=True, description="Indicate if all available public BGP monitors should be used, when ommited defaults to `bgpMeasurements` value.", alias="usePublicBgp") monitors: Optional[List[StrictStr]] = Field(default=None, description="Contains list of BGP monitor IDs (get `monitorId` from `/monitors` endpoint)") agents: List[TestAgentRequest] = Field(description="Contains list of Agent IDs (get `agentId` from `/agents` endpoint).") - __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "randomizedStartTime", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "bgpMeasurements", "usePublicBgp", "monitors", "agents"] + port: Optional[StrictInt] = Field(default=None, description="Port number to use for the test. The default port is 80.") + __properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "alertRules", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links", "labels", "sharedWithAccounts", "bandwidthMeasurements", "continuousMode", "fixedPacketRate", "mtuMeasurements", "numPathTraces", "pathTraceMode", "probeMode", "protocol", "randomizedStartTime", "server", "dscp", "dscpId", "ipv6Policy", "pingPayloadSize", "networkMeasurements", "bgpMeasurements", "usePublicBgp", "monitors", "agents", "port"] model_config = ConfigDict( populate_by_name=True, @@ -188,7 +189,8 @@ class AgentToServerTestRequest(BaseModel): "bgpMeasurements": obj.get("bgpMeasurements") if obj.get("bgpMeasurements") is not None else True, "usePublicBgp": obj.get("usePublicBgp") if obj.get("usePublicBgp") is not None else True, "monitors": obj.get("monitors"), - "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + "agents": [TestAgentRequest.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, + "port": obj.get("port") }) return _obj diff --git a/thousandeyes-sdk-tests/test/test_agent_to_server_tests_api.py b/thousandeyes-sdk-tests/test/test_agent_to_server_tests_api.py index 20b1a093..676d01e1 100644 --- a/thousandeyes-sdk-tests/test/test_agent_to_server_tests_api.py +++ b/thousandeyes-sdk-tests/test/test_agent_to_server_tests_api.py @@ -83,6 +83,7 @@ class TestAgentToServerTestsApi(unittest.TestCase): "createdDate" : "2022-07-17T22:00:54Z", "createdBy" : "user@user.com", "randomizedStartTime" : false, + "port" : 443, "modifiedDate" : "2022-07-17T22:00:54Z", "interval" : 60, "testId" : "281474976710706", @@ -558,6 +559,7 @@ class TestAgentToServerTestsApi(unittest.TestCase): "createdDate" : "2022-07-17T22:00:54Z", "createdBy" : "user@user.com", "randomizedStartTime" : false, + "port" : 443, "modifiedDate" : "2022-07-17T22:00:54Z", "interval" : 60, "testId" : "281474976710706", diff --git a/thousandeyes-sdk-usage/README.md b/thousandeyes-sdk-usage/README.md index 227fa534..55c61b70 100644 --- a/thousandeyes-sdk-usage/README.md +++ b/thousandeyes-sdk-usage/README.md @@ -17,7 +17,7 @@ Refer to the Usage API operations for detailed usage instructions and optional p This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 7.0.42 +- API version: 7.0.44 - Generator version: 7.6.0 - Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator