-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from blues/feat-openapi-update
feat: Add Alerts API to package
- Loading branch information
Showing
26 changed files
with
1,482 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Alert | ||
|
||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**uid** | **str** | Alert UID | [optional] | ||
**monitor_uid** | **str** | Monitor UID | [optional] | ||
**device_uid** | **str** | Device UID | [optional] | ||
**created_at** | **int** | The time the alert was created | [optional] | ||
**value** | **float** | The value that triggered the alert | [optional] | ||
**resolved** | **bool** | If true, the alert has been resolved | [optional] | ||
**version** | **int** | The version of the alert | [optional] | ||
**alert_source** | **str** | The source of the alert | [optional] | ||
**source** | **str** | The UID of the source of the alert | [optional] | ||
**data** | [**List[AlertDataInner]**](AlertDataInner.md) | | [optional] | ||
**notifications** | [**List[AlertNotificationsInner]**](AlertNotificationsInner.md) | | [optional] | ||
|
||
## Example | ||
|
||
```python | ||
from notehub_py.models.alert import Alert | ||
|
||
# TODO update the JSON string below | ||
json = "{}" | ||
# create an instance of Alert from a JSON string | ||
alert_instance = Alert.from_json(json) | ||
# print the JSON string representation of the object | ||
print(Alert.to_json()) | ||
|
||
# convert the object into a dict | ||
alert_dict = alert_instance.to_dict() | ||
# create an instance of Alert from a dict | ||
alert_from_dict = Alert.from_dict(alert_dict) | ||
``` | ||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# notehub_py.AlertApi | ||
|
||
All URIs are relative to *https://api.notefile.net* | ||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**get_alerts**](AlertApi.md#get_alerts) | **GET** /v1/projects/{projectUID}/alerts | | ||
|
||
|
||
# **get_alerts** | ||
> GetAlerts200Response get_alerts(project_uid, page_size=page_size, page_num=page_num) | ||
|
||
|
||
Get list of defined Alerts | ||
|
||
### Example | ||
|
||
* Api Key Authentication (api_key): | ||
|
||
```python | ||
import notehub_py | ||
from notehub_py.models.get_alerts200_response import GetAlerts200Response | ||
from notehub_py.rest import ApiException | ||
from pprint import pprint | ||
|
||
# Defining the host is optional and defaults to https://api.notefile.net | ||
# See configuration.py for a list of all supported configuration parameters. | ||
configuration = notehub_py.Configuration( | ||
host = "https://api.notefile.net" | ||
) | ||
|
||
# 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 API key authorization: api_key | ||
configuration.api_key['api_key'] = os.environ["API_KEY"] | ||
|
||
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed | ||
# configuration.api_key_prefix['api_key'] = 'Bearer' | ||
|
||
# Enter a context with an instance of the API client | ||
with notehub_py.ApiClient(configuration) as api_client: | ||
# Create an instance of the API class | ||
api_instance = notehub_py.AlertApi(api_client) | ||
project_uid = 'app:2606f411-dea6-44a0-9743-1130f57d77d8' # str | | ||
page_size = 50 # int | (optional) (default to 50) | ||
page_num = 1 # int | (optional) (default to 1) | ||
|
||
try: | ||
api_response = api_instance.get_alerts(project_uid, page_size=page_size, page_num=page_num) | ||
print("The response of AlertApi->get_alerts:\n") | ||
pprint(api_response) | ||
except Exception as e: | ||
print("Exception when calling AlertApi->get_alerts: %s\n" % e) | ||
``` | ||
|
||
|
||
|
||
### Parameters | ||
|
||
|
||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**project_uid** | **str**| | | ||
**page_size** | **int**| | [optional] [default to 50] | ||
**page_num** | **int**| | [optional] [default to 1] | ||
|
||
### Return type | ||
|
||
[**GetAlerts200Response**](GetAlerts200Response.md) | ||
|
||
### Authorization | ||
|
||
[api_key](../README.md#api_key) | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: Not defined | ||
- **Accept**: application/json | ||
|
||
### HTTP response details | ||
|
||
| Status code | Description | Response headers | | ||
|-------------|-------------|------------------| | ||
**200** | The response body from GET /alerts | - | | ||
**0** | The response body in case of an API 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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# AlertDataInner | ||
|
||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**alert_source** | **str** | The source of the alert | [optional] | ||
**source** | **str** | The UID of the source of the alert | [optional] | ||
**source_type** | **str** | The type of source. | [optional] | ||
**value** | **float** | The value that triggered the alert | [optional] | ||
**source_uid** | **str** | The UID of the source of the alert | [optional] | ||
**when** | **str** | The time the alert was created | [optional] | ||
|
||
## Example | ||
|
||
```python | ||
from notehub_py.models.alert_data_inner import AlertDataInner | ||
|
||
# TODO update the JSON string below | ||
json = "{}" | ||
# create an instance of AlertDataInner from a JSON string | ||
alert_data_inner_instance = AlertDataInner.from_json(json) | ||
# print the JSON string representation of the object | ||
print(AlertDataInner.to_json()) | ||
|
||
# convert the object into a dict | ||
alert_data_inner_dict = alert_data_inner_instance.to_dict() | ||
# create an instance of AlertDataInner from a dict | ||
alert_data_inner_from_dict = AlertDataInner.from_dict(alert_data_inner_dict) | ||
``` | ||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
Oops, something went wrong.