thousandeyes-sdk-python/thousandeyes-sdk-tests/docs/APITestsApi.md
2024-09-25 07:39:02 +00:00

20 KiB

thousandeyes_sdk.tests.APITestsApi

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

Method HTTP request Description
create_api_test POST /tests/api Create API test
delete_api_test DELETE /tests/api/{testId} Delete API test
get_api_test GET /tests/api/{testId} Get API test
get_api_tests GET /tests/api List API tests
update_api_test PUT /tests/api/{testId} Update API test

create_api_test

ApiTestResponse create_api_test(api_test_request, aid=aid, expand=expand)

Create API test

Creates a new API test. This method requires Account Admin permissions.

Example

  • Bearer Authentication (BearerAuth):
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.api_test_request import ApiTestRequest
from thousandeyes_sdk.tests.models.api_test_response import ApiTestResponse
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.tests.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = thousandeyes_sdk.tests.APITestsApi(api_client)
    api_test_request = thousandeyes_sdk.tests.ApiTestRequest() # ApiTestRequest | 
    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 API test
        api_response = api_instance.create_api_test(api_test_request, aid=aid, expand=expand)
        print("The response of APITestsApi->create_api_test:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling APITestsApi->create_api_test: %s\n" % e)

Parameters

Name Type Description Notes
api_test_request ApiTestRequest
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[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]

Return type

ApiTestResponse

Authorization

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 -
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]

delete_api_test

delete_api_test(test_id, aid=aid)

Delete API test

Deletes the specified API test. This method requires write permissions.

Example

  • Bearer Authentication (BearerAuth):
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.tests.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = thousandeyes_sdk.tests.APITestsApi(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 API test
        api_instance.delete_api_test(test_id, aid=aid)
    except Exception as e:
        print("Exception when calling APITestsApi->delete_api_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 `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_api_test

ApiTestResponse get_api_test(test_id, aid=aid, expand=expand)

Get API test

Returns details for a API test configuration. Please use expand parameter to access sub-resources such as alert rules and agents.

Example

  • Bearer Authentication (BearerAuth):
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.api_test_response import ApiTestResponse
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.tests.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = thousandeyes_sdk.tests.APITestsApi(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)
    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 API test
        api_response = api_instance.get_api_test(test_id, aid=aid, expand=expand)
        print("The response of APITestsApi->get_api_test:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling APITestsApi->get_api_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 `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[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]

Return type

ApiTestResponse

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]

get_api_tests

ApiTests get_api_tests(aid=aid)

List API tests

Returns a list of all API tests and saved events.

Example

  • Bearer Authentication (BearerAuth):
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.api_tests import ApiTests
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.tests.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = thousandeyes_sdk.tests.APITestsApi(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 API tests
        api_response = api_instance.get_api_tests(aid=aid)
        print("The response of APITestsApi->get_api_tests:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling APITestsApi->get_api_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

ApiTests

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]

update_api_test

ApiTestResponse update_api_test(test_id, api_test_request, aid=aid, expand=expand)

Update API test

Updates an API test. The target test cannot be a live share or saved event. This method requires write permissions.

Example

  • Bearer Authentication (BearerAuth):
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.api_test_request import ApiTestRequest
from thousandeyes_sdk.tests.models.api_test_response import ApiTestResponse
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.tests.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = thousandeyes_sdk.tests.APITestsApi(api_client)
    test_id = '202701' # str | Test ID
    api_test_request = thousandeyes_sdk.tests.ApiTestRequest() # ApiTestRequest | 
    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 API test
        api_response = api_instance.update_api_test(test_id, api_test_request, aid=aid, expand=expand)
        print("The response of APITestsApi->update_api_test:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling APITestsApi->update_api_test: %s\n" % e)

Parameters

Name Type Description Notes
test_id str Test ID
api_test_request ApiTestRequest
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[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]

Return type

ApiTestResponse

Authorization

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