18 KiB
tests.BGPApi
All URIs are relative to https://api.thousandeyes.com
| Method | HTTP request | Description |
|---|---|---|
| create_bgp_test | POST /v7/tests/bgp | Create BGP test |
| delete_bgp_test | DELETE /v7/tests/bgp/{testId} | Delete BGP test |
| get_bgp_test | GET /v7/tests/bgp/{testId} | Get BGP test |
| get_bgp_tests | GET /v7/tests/bgp | List BGP tests |
| update_bgp_test | PUT /v7/tests/bgp/{testId} | Update BGP test |
create_bgp_test
BgpTest create_bgp_test(update_bgp_test, aid=aid, expand=expand)
Create BGP test
Creates a new BGP test. This method requires Account Admin permissions.
Example
- Bearer Authentication (BearerAuth):
import tests
from tests.models.bgp_test import BgpTest
from tests.models.expand import Expand
from tests.models.update_bgp_test import UpdateBgpTest
from tests.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 = tests.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 = tests.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with tests.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = tests.BGPApi(api_client)
update_bgp_test = tests.UpdateBgpTest() # UpdateBgpTest |
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 = [tests.Expand()] # List[Expand] | 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 BGP test
api_response = api_instance.create_bgp_test(update_bgp_test, aid=aid, expand=expand)
print("The response of BGPApi->create_bgp_test:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BGPApi->create_bgp_test: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| update_bgp_test | UpdateBgpTest | ||
| 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[Expand]** | 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
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/hal+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_bgp_test
delete_bgp_test(test_id, aid=aid)
Delete BGP test
Deletes a BGP test. This method requires Account Admin permissions.
Example
- Bearer Authentication (BearerAuth):
import tests
from tests.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 = tests.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 = tests.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with tests.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = tests.BGPApi(api_client)
test_id = '281474976710706' # str | ID of the test
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 BGP test
api_instance.delete_bgp_test(test_id, aid=aid)
except Exception as e:
print("Exception when calling BGPApi->delete_bgp_test: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| test_id | str | ID of the test | |
| 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
HTTP request headers
- Content-Type: Not defined
- Accept: 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_bgp_test
BgpTest get_bgp_test(test_id, aid=aid, expand=expand)
Get BGP test
Returns details for a BGP test, including name, intervals, targets, alert rules and agents.
Example
- Bearer Authentication (BearerAuth):
import tests
from tests.models.bgp_test import BgpTest
from tests.models.expand import Expand
from tests.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 = tests.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 = tests.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with tests.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = tests.BGPApi(api_client)
test_id = '281474976710706' # str | ID of the test
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 = [tests.Expand()] # List[Expand] | 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 BGP test
api_response = api_instance.get_bgp_test(test_id, aid=aid, expand=expand)
print("The response of BGPApi->get_bgp_test:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BGPApi->get_bgp_test: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| test_id | str | ID of the test | |
| 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[Expand]** | 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
Authorization
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_bgp_tests
GetBgpTests200Response get_bgp_tests(aid=aid)
List BGP tests
Returns a list of BGP tests and saved events.
Example
- Bearer Authentication (BearerAuth):
import tests
from tests.models.get_bgp_tests200_response import GetBgpTests200Response
from tests.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 = tests.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 = tests.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with tests.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = tests.BGPApi(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 BGP tests
api_response = api_instance.get_bgp_tests(aid=aid)
print("The response of BGPApi->get_bgp_tests:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BGPApi->get_bgp_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
Authorization
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_bgp_test
BgpTest update_bgp_test(test_id, update_bgp_test_request, aid=aid, expand=expand)
Update BGP test
Updates a BGP test. This method requires Account Admin permissions. The target test cannot be a live share or saved event.
Example
- Bearer Authentication (BearerAuth):
import tests
from tests.models.bgp_test import BgpTest
from tests.models.expand import Expand
from tests.models.update_bgp_test_request import UpdateBgpTestRequest
from tests.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 = tests.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 = tests.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with tests.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = tests.BGPApi(api_client)
test_id = '281474976710706' # str | ID of the test
update_bgp_test_request = tests.UpdateBgpTestRequest() # UpdateBgpTestRequest |
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 = [tests.Expand()] # List[Expand] | 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 BGP test
api_response = api_instance.update_bgp_test(test_id, update_bgp_test_request, aid=aid, expand=expand)
print("The response of BGPApi->update_bgp_test:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BGPApi->update_bgp_test: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| test_id | str | ID of the test | |
| update_bgp_test_request | UpdateBgpTestRequest | ||
| 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[Expand]** | 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
Authorization
HTTP request headers
- Content-Type: application/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]