thousandeyes-sdk-python/thousandeyes-sdk-tests/docs/AgentToServerTestsApi.md
Miguel Pragosa cd1d84e1a4
Some checks failed
Python CI / build (push) Has been cancelled
[GitHub Bot] Generated python SDK (#106)
Co-authored-by: API Team <api-team@thousandeyes.com>
2025-06-20 12:31:19 +01:00

461 lines
22 KiB
Markdown

# thousandeyes_sdk.tests.AgentToServerTestsApi
All URIs are relative to *https://api.thousandeyes.com/v7*
Method | HTTP request | Description
------------- | ------------- | -------------
[**create_agent_to_server_test**](AgentToServerTestsApi.md#create_agent_to_server_test) | **POST** /tests/agent-to-server | Create Agent to Server test
[**delete_agent_to_server_test**](AgentToServerTestsApi.md#delete_agent_to_server_test) | **DELETE** /tests/agent-to-server/{testId} | Delete Agent to Server test
[**get_agent_to_server_test**](AgentToServerTestsApi.md#get_agent_to_server_test) | **GET** /tests/agent-to-server/{testId} | Get Agent to Server test
[**get_agent_to_server_tests**](AgentToServerTestsApi.md#get_agent_to_server_tests) | **GET** /tests/agent-to-server | List Agent to Server tests
[**update_agent_to_server_test**](AgentToServerTestsApi.md#update_agent_to_server_test) | **PUT** /tests/agent-to-server/{testId} | Update Agent to Server test
# **create_agent_to_server_test**
> AgentToServerTestResponse create_agent_to_server_test(agent_to_server_test_request, aid=aid, expand=expand)
Create Agent to Server test
Creates a new Agent to Server test. This method requires Account Admin permissions.
### Example
* Bearer Authentication (BearerAuth):
```python
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.agent_to_server_test_request import AgentToServerTestRequest
from thousandeyes_sdk.tests.models.agent_to_server_test_response import AgentToServerTestResponse
from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions
from thousandeyes_sdk.tests.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.tests.AgentToServerTestsApi(api_client)
agent_to_server_test_request = thousandeyes_sdk.tests.AgentToServerTestRequest() # AgentToServerTestRequest |
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.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional)
try:
# Create Agent to Server test
api_response = api_instance.create_agent_to_server_test(agent_to_server_test_request, aid=aid, expand=expand)
print("The response of AgentToServerTestsApi->create_agent_to_server_test:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AgentToServerTestsApi->create_agent_to_server_test: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**agent_to_server_test_request** | [**AgentToServerTestRequest**](AgentToServerTestRequest.md)| |
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
**expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the &#x60;agents&#x60; sub-resource, they need to pass the &#x60;?expand&#x3D;agent&#x60; query. | [optional]
### Return type
[**AgentToServerTestResponse**](AgentToServerTestResponse.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 |
|-------------|-------------|------------------|
**201** | Created | * Location - <br> |
**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)
# **delete_agent_to_server_test**
> delete_agent_to_server_test(test_id, aid=aid)
Delete Agent to Server test
Deletes an Agent to Server test. This method requires Account Admin permissions.
### Example
* Bearer Authentication (BearerAuth):
```python
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.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.tests.AgentToServerTestsApi(api_client)
test_id = '202701' # str | Test ID
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:
# Delete Agent to Server test
api_instance.delete_agent_to_server_test(test_id, aid=aid)
except Exception as e:
print("Exception when calling AgentToServerTestsApi->delete_agent_to_server_test: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**test_id** | **str**| Test ID |
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
### Return type
void (empty response body)
### Authorization
[BearerAuth](../README.md#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]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_agent_to_server_test**
> AgentToServerTestResponse get_agent_to_server_test(test_id, aid=aid, version_id=version_id, expand=expand)
Get Agent to Server test
Returns details for a Agent to Server test, including name, intervals, targets, alert rules and agents.
### Example
* Bearer Authentication (BearerAuth):
```python
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.agent_to_server_test_response import AgentToServerTestResponse
from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions
from thousandeyes_sdk.tests.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.tests.AgentToServerTestsApi(api_client)
test_id = '202701' # str | Test ID
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)
version_id = '1234' # str | The unique identifier for a specific version of the test settings. If provided, returns the test configuration as it existed at that version. To retrieve available version IDs, use the `/tests/{testId}/history` endpoint. If not specified, the current version of the test settings is returned. (optional)
expand = [thousandeyes_sdk.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional)
try:
# Get Agent to Server test
api_response = api_instance.get_agent_to_server_test(test_id, aid=aid, version_id=version_id, expand=expand)
print("The response of AgentToServerTestsApi->get_agent_to_server_test:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AgentToServerTestsApi->get_agent_to_server_test: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**test_id** | **str**| Test ID |
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
**version_id** | **str**| The unique identifier for a specific version of the test settings. If provided, returns the test configuration as it existed at that version. To retrieve available version IDs, use the &#x60;/tests/{testId}/history&#x60; endpoint. If not specified, the current version of the test settings is returned. | [optional]
**expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the &#x60;agents&#x60; sub-resource, they need to pass the &#x60;?expand&#x3D;agent&#x60; query. | [optional]
### Return type
[**AgentToServerTestResponse**](AgentToServerTestResponse.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json, application/json, application/problem+json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | 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]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_agent_to_server_tests**
> AgentToServerTests get_agent_to_server_tests(aid=aid)
List Agent to Server tests
Returns a list of Agent to Server tests and saved events. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.
### Example
* Bearer Authentication (BearerAuth):
```python
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.agent_to_server_tests import AgentToServerTests
from thousandeyes_sdk.tests.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.tests.AgentToServerTestsApi(api_client)
aid = '1234' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
try:
# List Agent to Server tests
api_response = api_instance.get_agent_to_server_tests(aid=aid)
print("The response of AgentToServerTestsApi->get_agent_to_server_tests:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AgentToServerTestsApi->get_agent_to_server_tests: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
### Return type
[**AgentToServerTests**](AgentToServerTests.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json, application/json, application/problem+json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | 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]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **update_agent_to_server_test**
> AgentToServerTestResponse update_agent_to_server_test(test_id, agent_to_server_test_request, aid=aid, expand=expand)
Update Agent to Server test
Updates an Agent to Server test. This method requires Account Admin permissions.
### Example
* Bearer Authentication (BearerAuth):
```python
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.agent_to_server_test_request import AgentToServerTestRequest
from thousandeyes_sdk.tests.models.agent_to_server_test_response import AgentToServerTestResponse
from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions
from thousandeyes_sdk.tests.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.tests.AgentToServerTestsApi(api_client)
test_id = '202701' # str | Test ID
agent_to_server_test_request = thousandeyes_sdk.tests.AgentToServerTestRequest() # AgentToServerTestRequest |
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.tests.ExpandTestOptions()] # List[ExpandTestOptions] | Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the `agents` sub-resource, they need to pass the `?expand=agent` query. (optional)
try:
# Update Agent to Server test
api_response = api_instance.update_agent_to_server_test(test_id, agent_to_server_test_request, aid=aid, expand=expand)
print("The response of AgentToServerTestsApi->update_agent_to_server_test:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AgentToServerTestsApi->update_agent_to_server_test: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**test_id** | **str**| Test ID |
**agent_to_server_test_request** | [**AgentToServerTestRequest**](AgentToServerTestRequest.md)| |
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. | [optional]
**expand** | [**List[ExpandTestOptions]**](ExpandTestOptions.md)| Optional parameter on whether or not to expand the test sub-resources. By default no expansion is going to take place if the query parameter is not present. If the user wishes to expand the &#x60;agents&#x60; sub-resource, they need to pass the &#x60;?expand&#x3D;agent&#x60; query. | [optional]
### Return type
[**AgentToServerTestResponse**](AgentToServerTestResponse.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)