mirror of
https://github.com/thousandeyes/thousandeyes-sdk-python.git
synced 2025-12-06 14:36:50 +00:00
* CP-2189 Update SDK names for admin and monitors modules * CP-2189 Move client to core * CP-2189 Change client to core
102 lines
4.8 KiB
Markdown
102 lines
4.8 KiB
Markdown
# thousandeyes_sdk.instant_tests.AgentToServerApi
|
|
|
|
All URIs are relative to *https://api.thousandeyes.com*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**create_agent_to_server_instant_test**](AgentToServerApi.md#create_agent_to_server_instant_test) | **POST** /v7/tests/agent-to-server/instant | Create agent-to-server instant test
|
|
|
|
|
|
# **create_agent_to_server_instant_test**
|
|
> AgentToServerInstantTest create_agent_to_server_instant_test(agent_to_server_instant_test_request, aid=aid, expand=expand)
|
|
|
|
Create agent-to-server instant test
|
|
|
|
Creates and runs a new agent-to-server instant test.
|
|
|
|
### Example
|
|
|
|
* Bearer Authentication (BearerAuth):
|
|
|
|
```python
|
|
import thousandeyes_sdk.instant_tests
|
|
from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test import AgentToServerInstantTest
|
|
from thousandeyes_sdk.instant_tests.models.agent_to_server_instant_test_request import AgentToServerInstantTestRequest
|
|
from thousandeyes_sdk.instant_tests.models.expand import Expand
|
|
from thousandeyes_sdk.instant_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 = thousandeyes_sdk.core.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 = thousandeyes_sdk.core.Configuration(
|
|
access_token = os.environ["BEARER_TOKEN"]
|
|
)
|
|
|
|
# Enter a context with an instance of the API client
|
|
with thousandeyes_sdk.instant_tests.ApiClient(configuration) as api_client:
|
|
# Create an instance of the API class
|
|
api_instance = thousandeyes_sdk.instant_tests.AgentToServerApi(api_client)
|
|
agent_to_server_instant_test_request = thousandeyes_sdk.instant_tests.AgentToServerInstantTestRequest() # AgentToServerInstantTestRequest |
|
|
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.instant_tests.Expand()] # List[Expand] | (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. (optional)
|
|
|
|
try:
|
|
# Create agent-to-server instant test
|
|
api_response = api_instance.create_agent_to_server_instant_test(agent_to_server_instant_test_request, aid=aid, expand=expand)
|
|
print("The response of AgentToServerApi->create_agent_to_server_instant_test:\n")
|
|
pprint(api_response)
|
|
except Exception as e:
|
|
print("Exception when calling AgentToServerApi->create_agent_to_server_instant_test: %s\n" % e)
|
|
```
|
|
|
|
|
|
|
|
### Parameters
|
|
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**agent_to_server_instant_test_request** | [**AgentToServerInstantTestRequest**](AgentToServerInstantTestRequest.md)| |
|
|
**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]**](Expand.md)| (Optional) Indicates if the test sub-resources should be expanded. Defaults to no expansion. To expand the `agents` sub-resource, use the query `?expand=agent`. | [optional]
|
|
|
|
### Return type
|
|
|
|
[**AgentToServerInstantTest**](AgentToServerInstantTest.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)
|
|
|