thousandeyes-sdk-python/thousandeyes-sdk-tests/docs/TestsApi.md
2025-06-05 12:21:12 +00:00

7.2 KiB

thousandeyes_sdk.tests.TestsApi

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

Method HTTP request Description
get_test_version_history GET /tests/{testId}/history Get test version history
get_tests GET /tests List configured tests

get_test_version_history

TestVersionHistoryResponse get_test_version_history(test_id, aid=aid, limit=limit)

Get test version history

Retrieve the version history of a specific test.

Example

  • Bearer Authentication (BearerAuth):
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.test_version_history_response import TestVersionHistoryResponse
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.TestsApi(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)
    limit = 50 # int | The maximum number of version history entries to return. If not specified, the default is 50 or the total number of available versions, whichever is fewer. (optional) (default to 50)

    try:
        # Get test version history
        api_response = api_instance.get_test_version_history(test_id, aid=aid, limit=limit)
        print("The response of TestsApi->get_test_version_history:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TestsApi->get_test_version_history: %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 `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]
limit int The maximum number of version history entries to return. If not specified, the default is 50 or the total number of available versions, whichever is fewer. [optional] [default to 50]

Return type

TestVersionHistoryResponse

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: 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 -
500 Internal server error -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_tests

Tests get_tests(aid=aid)

List configured tests

Returns configured 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):
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.tests import 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.TestsApi(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 configured tests
        api_response = api_instance.get_tests(aid=aid)
        print("The response of TestsApi->get_tests:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TestsApi->get_tests: %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]

Return type

Tests

Authorization

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] [Back to Model list] [Back to README]