thousandeyes-sdk-python/thousandeyes-sdk-tests/docs/PageLoadTestsApi.md
Miguel Pragosa dcf0f54d56
Some checks failed
Python CI / build (push) Has been cancelled
[GitHub Bot] Generated python SDK (#96)
Co-authored-by: API Team <api-team@thousandeyes.com>
2025-04-02 12:58:49 +01:00

20 KiB

thousandeyes_sdk.tests.PageLoadTestsApi

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

Method HTTP request Description
create_page_load_test POST /tests/page-load Create Page Load test
delete_page_load_test DELETE /tests/page-load/{testId} Delete Page Load test
get_page_load_test GET /tests/page-load/{testId} Get Page Load test
get_page_load_tests GET /tests/page-load List Page Load tests
update_page_load_test PUT /tests/page-load/{testId} Update Page Load test

create_page_load_test

PageLoadTestResponse create_page_load_test(page_load_test_request, aid=aid, expand=expand)

Create Page Load test

Creates a new Page Load test. This method requires Account Admin permissions.

Example

  • Bearer Authentication (BearerAuth):
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions
from thousandeyes_sdk.tests.models.page_load_test_request import PageLoadTestRequest
from thousandeyes_sdk.tests.models.page_load_test_response import PageLoadTestResponse
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.PageLoadTestsApi(api_client)
    page_load_test_request = thousandeyes_sdk.tests.PageLoadTestRequest() # PageLoadTestRequest | 
    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 Page Load test
        api_response = api_instance.create_page_load_test(page_load_test_request, aid=aid, expand=expand)
        print("The response of PageLoadTestsApi->create_page_load_test:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PageLoadTestsApi->create_page_load_test: %s\n" % e)

Parameters

Name Type Description Notes
page_load_test_request PageLoadTestRequest
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

PageLoadTestResponse

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_page_load_test

delete_page_load_test(test_id, aid=aid)

Delete Page Load test

Deletes the specified Page Load test. This method requires Account Admin 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.core.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = thousandeyes_sdk.tests.PageLoadTestsApi(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 Page Load test
        api_instance.delete_page_load_test(test_id, aid=aid)
    except Exception as e:
        print("Exception when calling PageLoadTestsApi->delete_page_load_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_page_load_test

PageLoadTestResponse get_page_load_test(test_id, aid=aid, expand=expand)

Get Page Load test

Returns details for a Page Load test, including name, intervals, targets, alert rules and agents.

Example

  • Bearer Authentication (BearerAuth):
import thousandeyes_sdk.tests
from thousandeyes_sdk.tests.models.expand_test_options import ExpandTestOptions
from thousandeyes_sdk.tests.models.page_load_test_response import PageLoadTestResponse
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.PageLoadTestsApi(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 Page Load test
        api_response = api_instance.get_page_load_test(test_id, aid=aid, expand=expand)
        print("The response of PageLoadTestsApi->get_page_load_test:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PageLoadTestsApi->get_page_load_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

PageLoadTestResponse

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_page_load_tests

PageLoadTests get_page_load_tests(aid=aid)

List Page Load tests

Returns a list of all Page Load 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.page_load_tests import PageLoadTests
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.PageLoadTestsApi(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 Page Load tests
        api_response = api_instance.get_page_load_tests(aid=aid)
        print("The response of PageLoadTestsApi->get_page_load_tests:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PageLoadTestsApi->get_page_load_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

PageLoadTests

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_page_load_test

PageLoadTestResponse update_page_load_test(test_id, page_load_test_request, aid=aid, expand=expand)

Update Page Load test

Updates a Page Load test. The target test cannot be a live share or saved event. This method requires Account Admin permissions. 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.expand_test_options import ExpandTestOptions
from thousandeyes_sdk.tests.models.page_load_test_request import PageLoadTestRequest
from thousandeyes_sdk.tests.models.page_load_test_response import PageLoadTestResponse
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.PageLoadTestsApi(api_client)
    test_id = '202701' # str | Test ID
    page_load_test_request = thousandeyes_sdk.tests.PageLoadTestRequest() # PageLoadTestRequest | 
    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 Page Load test
        api_response = api_instance.update_page_load_test(test_id, page_load_test_request, aid=aid, expand=expand)
        print("The response of PageLoadTestsApi->update_page_load_test:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PageLoadTestsApi->update_page_load_test: %s\n" % e)

Parameters

Name Type Description Notes
test_id str Test ID
page_load_test_request PageLoadTestRequest
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

PageLoadTestResponse

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]