-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
The AgentDetails model has various properties, such as agent_id, agent_name, ip_addresses and more. This model is returned in the response for the get_agent operation.
However, the model seems to have some sort of abstract wrapper around it. Trying to directly access agent_id, agent_name, ip_addresses or other properties on the AgentDetails model fails with an AttributeError. Instead, it seems this class has a property actual_instance which itself has the aforementioned properties.
Example code:
import os
import thousandeyes_sdk.core
import thousandeyes_sdk.agents
configuration = thousandeyes_sdk.core.Configuration(
access_token = os.getenv('BEARER_TOKEN', '')
)
api_client = thousandeyes_sdk.core.ApiClient(configuration)
api_instance = thousandeyes_sdk.agents.CloudAndEnterpriseAgentsApi(api_client)
api_response = api_instance.get_agent("3")
print(api_response.ip_addresses) # Raises an AttributeError
print(api_response.agent_id) # Raises an AttributeError
print(api_response.agent_name) # Raises an AttributeError
print(api_response) # Shows the instance details,
# including the `actual_instance` property, which itself
# contains the agent_id, agent_name, and ip_addresses properties
print(api_response.actual_instance.agent_name) # This worksMetadata
Metadata
Assignees
Labels
No labels