thousandeyes-sdk-python/agents_api/docs/CloudAndEnterpriseAgentsApi.md
2023-12-11 09:29:15 +00:00

19 KiB
Raw Blame History

agents_api.CloudAndEnterpriseAgentsApi

All URIs are relative to https://api.thousandeyes.com

Method HTTP request Description
delete_enterprise_agent DELETE /v7/agents/{agentId} Delete Enterprise Agent
get_agent_details GET /v7/agents/{agentId} Retrieve Cloud and Enterprise Agent
get_agents GET /v7/agents List Cloud and Enterprise Agents
update_enterprise_agent_details PUT /v7/agents/{agentId} Update Enterprise Agent

delete_enterprise_agent

delete_enterprise_agent(agent_id, aid=aid)

Delete Enterprise Agent

Deletes an Enterprise Agent. Important notes related to agent removal: * If an agent is deleted, the modification date for tests using that agent at the time it was deleted will be changed. * If a deleted agent is the final remaining agent on a test, then the test will be disabled when the agent is removed. * If an agent is removed, it must be re-initialized to use the same machine again in different context. Virtual Appliances can be updated using the Reset State button in the Advanced tab of the agent management interface. Users running packaged versions of Linux will need to remove /var/lib/te-agent/\*.sqlite in order to reinitialize an agent.

Example

  • Bearer Authentication (BearerAuth):
import time
import os
import agents_api
from agents_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = agents_api.Configuration(
    host = "https://api.thousandeyes.com"
)

# 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 = agents_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with agents_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = agents_api.CloudAndEnterpriseAgentsApi(api_client)
    agent_id = '281474976710706' # str | Unique ID for the agent.
    aid = '2067' # 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:
        # Delete Enterprise Agent
        api_instance.delete_enterprise_agent(agent_id, aid=aid)
    except Exception as e:
        print("Exception when calling CloudAndEnterpriseAgentsApi->delete_enterprise_agent: %s\n" % e)

Parameters

Name Type Description Notes
agent_id str Unique ID for the agent.
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

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

HTTP response details

Status code Description Response headers
204 No content -
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] [Back to Model list] [Back to README]

get_agent_details

GetAgentDetails200Response get_agent_details(agent_id, aid=aid, expand=expand)

Retrieve Cloud and Enterprise Agent

Returns details for an agent, including assigned tests. For Enterprise Agents, this endpoint returns additional details, including utilization data, assigned accounts, a list of account groups the agent is assigned to, and utilization details.

Example

  • Bearer Authentication (BearerAuth):
import time
import os
import agents_api
from agents_api.models.agent_details_expand import AgentDetailsExpand
from agents_api.models.get_agent_details200_response import GetAgentDetails200Response
from agents_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = agents_api.Configuration(
    host = "https://api.thousandeyes.com"
)

# 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 = agents_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with agents_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = agents_api.CloudAndEnterpriseAgentsApi(api_client)
    agent_id = '281474976710706' # str | Unique ID for the agent.
    aid = '2067' # 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 = [agents_api.AgentDetailsExpand()] # List[AgentDetailsExpand] | 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)

    try:
        # Retrieve Cloud and Enterprise Agent
        api_response = api_instance.get_agent_details(agent_id, aid=aid, expand=expand)
        print("The response of CloudAndEnterpriseAgentsApi->get_agent_details:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CloudAndEnterpriseAgentsApi->get_agent_details: %s\n" % e)

Parameters

Name Type Description Notes
agent_id str Unique ID for the agent.
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[AgentDetailsExpand]** 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]

Return type

GetAgentDetails200Response

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/hal+json, application/problem+json

HTTP response details

Status code Description Response headers
200 OK -
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] [Back to Model list] [Back to README]

get_agents

GetAgents200Response get_agents(aid=aid, expand=expand, agent_types=agent_types)

List Cloud and Enterprise Agents

Returns a list of all agents available to your ThousandEyes account, including both Enterprise and Cloud Agents. If an agent is an Enterprise Agent, this endpoint returns the agents public and private IP addresses, as well as the public network where the agent is located.

Example

  • Bearer Authentication (BearerAuth):
import time
import os
import agents_api
from agents_api.models.agent_list_expand import AgentListExpand
from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
from agents_api.models.get_agents200_response import GetAgents200Response
from agents_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = agents_api.Configuration(
    host = "https://api.thousandeyes.com"
)

# 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 = agents_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with agents_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = agents_api.CloudAndEnterpriseAgentsApi(api_client)
    aid = '2067' # 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 = [agents_api.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 = [agents_api.CloudEnterpriseAgentType()] # List[CloudEnterpriseAgentType] | Specifies the type of agent to request. (optional)

    try:
        # List Cloud and Enterprise Agents
        api_response = api_instance.get_agents(aid=aid, expand=expand, agent_types=agent_types)
        print("The response of CloudAndEnterpriseAgentsApi->get_agents:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CloudAndEnterpriseAgentsApi->get_agents: %s\n" % e)

Parameters

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]** 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]** Specifies the type of agent to request. [optional]

Return type

GetAgents200Response

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/hal+json, application/problem+json

HTTP response details

Status code Description Response headers
200 OK -
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] [Back to Model list] [Back to README]

update_enterprise_agent_details

UpdateEnterpriseAgentDetails200Response update_enterprise_agent_details(agent_id, enterprise_agent_request_body, aid=aid, expand=expand)

Update Enterprise Agent

Updates details for an Enterprise Agent. This endpoint can only be used for Enterprise Agents, and only for users in a role that permits modification of Enterprise Agents. Important notes related to agent modification on tests: * if an agent is removed from a test, the modification date for tests using that agent at the time it was removed will be changed. * If an agent is removed from an entire account group, then all tests using this agent in the removed account group will be updated to reflect the removed agent. * If a removed agent is the final remaining agent on a test, then the test will be disabled when the agent is removed. Users can update the following fields: * agentName: String representation of an agent. No two agents can have the same display name. * enabled: Boolean representation of agent state. * accountGroups: An array of account group ids. See v7/account-groups to pull a list of account IDs. * tests: An array of test Is. See v7/tests to retrieve a list tests available in the current account context. * ipv6Policy: Enum representation of the IP version policy. * keepBrowserCache: Boolean representation of the Keep browser cache state. * targetForTests: String representation of the target IP address or domain name. This represents the test destination when agent is acting as a test target in an agent-to-agent test. * localResolutionPrefixes: This array of strings represents the public IP ranges where the Enterprise Agent performs rDNS (Reverse DNS) lookups. The range should be in CIDR notation, such as 10.1.1.0/24. Please note that a maximum of 5 prefixes is allowed. This only applies to Enterprise Agents and Enterprise Agent clusters.

Example

  • Bearer Authentication (BearerAuth):
import time
import os
import agents_api
from agents_api.models.agent_details_expand import AgentDetailsExpand
from agents_api.models.enterprise_agent_request_body import EnterpriseAgentRequestBody
from agents_api.models.update_enterprise_agent_details200_response import UpdateEnterpriseAgentDetails200Response
from agents_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = agents_api.Configuration(
    host = "https://api.thousandeyes.com"
)

# 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 = agents_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with agents_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = agents_api.CloudAndEnterpriseAgentsApi(api_client)
    agent_id = '281474976710706' # str | Unique ID for the agent.
    enterprise_agent_request_body = agents_api.EnterpriseAgentRequestBody() # EnterpriseAgentRequestBody | 
    aid = '2067' # 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 = [agents_api.AgentDetailsExpand()] # List[AgentDetailsExpand] | 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)

    try:
        # Update Enterprise Agent
        api_response = api_instance.update_enterprise_agent_details(agent_id, enterprise_agent_request_body, aid=aid, expand=expand)
        print("The response of CloudAndEnterpriseAgentsApi->update_enterprise_agent_details:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CloudAndEnterpriseAgentsApi->update_enterprise_agent_details: %s\n" % e)

Parameters

Name Type Description Notes
agent_id str Unique ID for the agent.
enterprise_agent_request_body EnterpriseAgentRequestBody
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[AgentDetailsExpand]** 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]

Return type

UpdateEnterpriseAgentDetails200Response

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/hal+json
  • Accept: application/hal+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] [Back to Model list] [Back to README]