thousandeyes-sdk-python/streaming_api/docs/StreamingApi.md
2023-12-11 09:29:15 +00:00

442 lines
17 KiB
Markdown

# streaming_api.StreamingApi
All URIs are relative to *https://api.thousandeyes.com*
Method | HTTP request | Description
------------- | ------------- | -------------
[**create_stream**](StreamingApi.md#create_stream) | **POST** /v7/stream | Create data stream
[**delete_stream**](StreamingApi.md#delete_stream) | **DELETE** /v7/stream/{id} | Delete a data stream
[**get_stream**](StreamingApi.md#get_stream) | **GET** /v7/stream/{id} | Retrieve data stream
[**get_streams**](StreamingApi.md#get_streams) | **GET** /v7/stream | List data streams
[**put_stream**](StreamingApi.md#put_stream) | **PUT** /v7/stream/{id} | Update data stream
# **create_stream**
> CreateStreamResponse create_stream(aid=aid, stream=stream)
Create data stream
Creates a new data stream.
### Example
* Bearer Authentication (BearerAuth):
```python
import time
import os
import streaming_api
from streaming_api.models.create_stream_response import CreateStreamResponse
from streaming_api.models.stream import Stream
from streaming_api.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 = streaming_api.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 = streaming_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with streaming_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = streaming_api.StreamingApi(api_client)
aid = '2067' # 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)
stream = streaming_api.Stream() # Stream | Stream to configure (optional)
try:
# Create data stream
api_response = api_instance.create_stream(aid=aid, stream=stream)
print("The response of StreamingApi->create_stream:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling StreamingApi->create_stream: %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]
**stream** | [**Stream**](Stream.md)| Stream to configure | [optional]
### Return type
[**CreateStreamResponse**](CreateStreamResponse.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** | item created | - |
**400** | Bad Request | - |
**401** | Unauthorized | - |
**409** | An existing item already exists | - |
**412** | Reached limit on number of streams (maximum 1 data stream per account group) | - |
**500** | Internal Server Error | - |
[[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)
# **delete_stream**
> delete_stream(id, aid=aid)
Delete a data stream
Deletes a configured data stream using its ID.
### Example
* Bearer Authentication (BearerAuth):
```python
import time
import os
import streaming_api
from streaming_api.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 = streaming_api.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 = streaming_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with streaming_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = streaming_api.StreamingApi(api_client)
id = 'id_example' # str | ID of stream to query
aid = '2067' # 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 a data stream
api_instance.delete_stream(id, aid=aid)
except Exception as e:
print("Exception when calling StreamingApi->delete_stream: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **str**| ID of stream to query |
**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](../README.md#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** | Forbidden | - |
**404** | Not Found | - |
**429** | Too Many Requests | - |
**500** | Internal Server Error | - |
[[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)
# **get_stream**
> GetStreamResponse get_stream(id, aid=aid, type=type)
Retrieve data stream
Retrieves a configured data stream using its ID.
### Example
* Bearer Authentication (BearerAuth):
```python
import time
import os
import streaming_api
from streaming_api.models.get_stream_response import GetStreamResponse
from streaming_api.models.stream_type import StreamType
from streaming_api.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 = streaming_api.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 = streaming_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with streaming_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = streaming_api.StreamingApi(api_client)
id = 'id_example' # str | ID of stream to query
aid = '2067' # 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)
type = streaming_api.StreamType() # StreamType | Optional filter on type of Stream; should match one of Stream `type` enum (optional)
try:
# Retrieve data stream
api_response = api_instance.get_stream(id, aid=aid, type=type)
print("The response of StreamingApi->get_stream:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling StreamingApi->get_stream: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **str**| ID of stream to query |
**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]
**type** | [**StreamType**](.md)| Optional filter on type of Stream; should match one of Stream `type` enum | [optional]
### Return type
[**GetStreamResponse**](GetStreamResponse.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+json, application/problem+json, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
**401** | Unauthorized | - |
**403** | Forbidden | - |
**404** | Not Found | - |
**429** | Too Many Requests | - |
**500** | Internal Server Error | - |
[[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)
# **get_streams**
> List[GetStreamResponse] get_streams(aid=aid, type=type)
List data streams
Retrieves a list of configured data streams.
### Example
* Bearer Authentication (BearerAuth):
```python
import time
import os
import streaming_api
from streaming_api.models.get_stream_response import GetStreamResponse
from streaming_api.models.stream_type import StreamType
from streaming_api.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 = streaming_api.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 = streaming_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with streaming_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = streaming_api.StreamingApi(api_client)
aid = '2067' # 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)
type = streaming_api.StreamType() # StreamType | Optional filter on type of Stream; should match one of Stream `type` enum (optional)
try:
# List data streams
api_response = api_instance.get_streams(aid=aid, type=type)
print("The response of StreamingApi->get_streams:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling StreamingApi->get_streams: %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]
**type** | [**StreamType**](.md)| Optional filter on type of Stream; should match one of Stream `type` enum | [optional]
### Return type
[**List[GetStreamResponse]**](GetStreamResponse.md)
### Authorization
[BearerAuth](../README.md#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 | - |
**400** | Bad Request | - |
**401** | Unauthorized | - |
**403** | Forbidden | - |
**404** | Not Found | - |
**429** | Too Many Requests | - |
**500** | Internal Server Error | - |
[[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)
# **put_stream**
> GetStreamResponse put_stream(id, aid=aid, put_stream=put_stream)
Update data stream
Updates a configured data stream using its ID. The fields are overwritten, not appended.
### Example
* Bearer Authentication (BearerAuth):
```python
import time
import os
import streaming_api
from streaming_api.models.get_stream_response import GetStreamResponse
from streaming_api.models.put_stream import PutStream
from streaming_api.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 = streaming_api.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 = streaming_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with streaming_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = streaming_api.StreamingApi(api_client)
id = 'id_example' # str | ID of stream to query
aid = '2067' # 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)
put_stream = streaming_api.PutStream() # PutStream | (optional)
try:
# Update data stream
api_response = api_instance.put_stream(id, aid=aid, put_stream=put_stream)
print("The response of StreamingApi->put_stream:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling StreamingApi->put_stream: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **str**| ID of stream to query |
**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]
**put_stream** | [**PutStream**](PutStream.md)| | [optional]
### Return type
[**GetStreamResponse**](GetStreamResponse.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 |
|-------------|-------------|------------------|
**200** | Stream updated | - |
**204** | No content | - |
**400** | Bad Request | - |
**401** | Unauthorized | - |
**403** | Forbidden | - |
**404** | Not Found | - |
**429** | Too Many Requests | - |
**500** | Internal Server Error | - |
[[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)