Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AgentDetails model apparently not working as documented #83

Open
josdough-te opened this issue Nov 14, 2024 · 0 comments
Open

AgentDetails model apparently not working as documented #83

josdough-te opened this issue Nov 14, 2024 · 0 comments

Comments

@josdough-te
Copy link

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 works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant