Notehub Py Library Overview
The Notehub Py library is a PyPI library built specifically for use in Python-based applications.
It is designed to get you connected to the Notehub API quickly, and allow you to access all the API routes relevant to interacting with Notehub in a Python-friendly way.
Installation
You can install the Notehub Py library in any Python-based application using the steps below.
In the root of the project where you wish to use Notehub Py, run the following command from the terminal.
Using pip via PyPI:
python3 -m pip install notehub-py
Once the package is installed, you can import the library using import
:
Using import
:
import notehub_py
Usage
Below is documentation and code examples for all the Notehub API methods.
There is one main type of authorization the Notehub API uses for nearly all requests:
API Key
The api_key
referenced in the following code examples is an API key (also known locally
as an X-Session-Token
).
The API key is an authentication token that can be obtained in two ways:
Manually cURL the token from the command line
Using the command line, a user can request a new token from the
Notehub API /auth/login
endpoint
using a Notehub username and password in the body of the request.
Use notehub_py.AuthorizationApi login
Using the Notehub Py library, a user can programmatically call the Notehub API's /auth/login
endpoint
via the notehub_py.AuthorizationApi's login()
method while supplying a Notehub username and
password in the loginRequest
object.
API Calls and Consumption Credits
Be aware that all Notehub API calls made using the Notehub JS library utilize your account's Consumption Credits (CCs). For more information, please consult our pricing page.
All URIs are relative to https://api.notefile.net
Method | HTTP Request |
---|---|
login | POST /auth/login |
This is the only Notehub API call that does not require some form of authentication token, and it is used to generate the token which can then be used for almost all subsequent API requests.
login
Gets a session token from the API from a username and password.
Example
import notehub_py
from notehub_py.models.login200_response import Login200Response
from notehub_py.models.login_request import LoginRequest
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# 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.AuthorizationApi(api_client)
login_request = {"username":"name@example.com","password":"test-password"} # LoginRequest |
try:
api_response = api_instance.login(login_request)
print("The response of AuthorizationApi->login:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AuthorizationApi->login: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
login_request | LoginRequest |
LoginRequest Properties
Name | Type | Description | Notes |
---|---|---|---|
username | str | [optional] | |
password | str | [optional] |
No authorization required
Billing Account API
Method | HTTP Request |
---|---|
get_billing_accounts | GET /v1/billing-accounts |
get_billing_accounts
Get Billing Accounts accessible by the api_key
Example
import notehub_py
from notehub_py.models.get_billing_accounts200_response import GetBillingAccounts200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.BillingAccountApi(api_client)
try:
api_response = api_instance.get_billing_accounts()
print("The response of BillingAccountApi->get_billing_accounts:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BillingAccountApi->get_billing_accounts: %s\n" % e)
Parameters
This endpoint does not need any parameter.
Return type
Successful 200 get_billing_accounts response
Device API
Method | HTTP Request |
---|---|
delete_device_environment_variable | DELETE /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables/\{key\} |
delete_project_device | DELETE /v1/projects/{projectUID}/devices/{deviceUID} |
disable_device | POST /v1/projects/{projectUID}/devices/{deviceUID}/disable |
disable_device_connectivity_assurance | POST /v1/projects/{projectUID}/devices/{deviceUID}/disable-connectivity-assurance |
enable_device | POST /v1/projects/{projectUID}/devices/{deviceUID}/enable |
enable_device_connectivity_assurance | POST /v1/projects/{projectUID}/devices/{deviceUID}/enable-connectivity-assurance |
get_device | GET /v1/projects/{projectUID}/devices/{deviceUID} |
get_device_environment_variables | GET /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables |
get_device_environment_variables_by_pin | GET /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin |
get_device_health_log | GET /v1/projects/{projectUID}/devices/{deviceUID}/health-log |
get_device_latest | GET /v1/projects/{projectUID}/devices/{deviceUID}/latest |
get_device_public_key | GET /v1/projects/{projectUID}/devices/{deviceUID}/public-key |
get_device_sessions | GET /v1/projects/{projectUID}/devices/{deviceUID}/sessions |
get_project_device_public_keys | GET /v1/projects/{projectUID}/devices/public-keys |
get_project_devices | GET /v1/projects/{projectUID}/devices |
get_project_fleet_devices | GET /v1/projects/{projectUID}/fleets/{fleetUID}/devices |
handle_note_add | POST /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID} |
handle_note_changes | GET /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/changes |
handle_note_create_add | POST /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} |
handle_note_delete | DELETE /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} |
handle_note_get | GET /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} |
handle_note_signal | POST /v1/projects/{projectUID}/devices/{deviceUID}/signal |
handle_note_update | PUT /v1/projects/{projectUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} |
handle_notefile_changes | GET /v1/projects/{projectUID}/devices/{deviceUID}/files/changes |
handle_notefile_changes_pending | GET /v1/projects/{projectUID}/devices/{deviceUID}/files/changes/pending |
handle_notefile_delete | DELETE /v1/projects/{projectUID}/devices/{deviceUID}/files |
post_provision_project_device | POST /v1/projects/{projectUID}/devices/{deviceUID}/provision |
put_device_environment_variables | PUT /v1/projects/{projectUID}/devices/{deviceUID}/environment_variables |
put_device_environment_variables_by_pin | PUT /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin |
delete_device_environment_variable
Delete environment variable of a device
Example
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
key = "key_example" # str | The environment variable key to delete.
try:
api_response = api_instance.delete_device_environment_variable(project_uid, device_uid, key)
print("The response of DeviceApi->delete_device_environment_variable:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->delete_device_environment_variable: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
key | str | The environment variable key to delete. |
Return type
Successful 200 delete_device_environment_variable response
delete_project_device
Delete Device
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
purge = False # bool | (default to False)
try:
api_instance.delete_project_device(project_uid, device_uid, purge)
except Exception as e:
print("Exception when calling DeviceApi->delete_project_device: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
purge | bool | [default to False] |
Return type
void (empty response body)
disable_device
Disable Device
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_instance.disable_device(project_uid, device_uid)
except Exception as e:
print("Exception when calling DeviceApi->disable_device: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str |
Return type
void (empty response body)
disable_device_connectivity_assurance
Disable Connectivity Assurance
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_instance.disable_device_connectivity_assurance(project_uid, device_uid)
except Exception as e:
print("Exception when calling DeviceApi->disable_device_connectivity_assurance: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str |
Return type
void (empty response body)
enable_device
Enable Device
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_instance.enable_device(project_uid, device_uid)
except Exception as e:
print("Exception when calling DeviceApi->enable_device: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str |
Return type
void (empty response body)
enable_device_connectivity_assurance
Enable Connectivity Assurance
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_instance.enable_device_connectivity_assurance(project_uid, device_uid)
except Exception as e:
print("Exception when calling DeviceApi->enable_device_connectivity_assurance: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str |
Return type
void (empty response body)
get_device
Get Device
Example
import notehub_py
from notehub_py.models.device import Device
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_response = api_instance.get_device(project_uid, device_uid)
print("The response of DeviceApi->get_device:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_device: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str |
Return type
Successful 200 get_device response
get_device_environment_variables
Get environment variables of a device
Example
import notehub_py
from notehub_py.models.get_device_environment_variables200_response import GetDeviceEnvironmentVariables200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_response = api_instance.get_device_environment_variables(project_uid, device_uid)
print("The response of DeviceApi->get_device_environment_variables:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_device_environment_variables: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str |
Return type
Successful 200 get_device_environment_variables response
get_device_environment_variables_by_pin
Get environment variables of a device with device pin authorization
Example
import notehub_py
from notehub_py.models.get_device_environment_variables200_response import GetDeviceEnvironmentVariables200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: pin
configuration.api_key["pin"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
product_uid = "com.blues.bridge:sensors" # str |
device_uid = "device_uid_example" # str |
try:
api_response = api_instance.get_device_environment_variables_by_pin(product_uid, device_uid)
print("The response of DeviceApi->get_device_environment_variables_by_pin:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_device_environment_variables_by_pin: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
product_uid | str | ||
device_uid | str |
pin
get_device_health_log
Get Device Health Log
Example
import notehub_py
from notehub_py.models.get_device_health_log200_response import GetDeviceHealthLog200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_response = api_instance.get_device_health_log(project_uid, device_uid)
print("The response of DeviceApi->get_device_health_log:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_device_health_log: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project _uid | str | ||
device_uid | str |
Return type
Successful 200 get_device_health_log response
get_device_latest
Get Device Latest Events
Example
import notehub_py
from notehub_py.models.get_device_latest200_response import GetDeviceLatest200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_response = api_instance.get_device_latest(project_uid, device_uid)
print("The response of DeviceApi->get_device_latest:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_device_latest: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str |
Return type
Successful 200 get_device_latest response
get_device_public_key
Get Device Public Key
Example
import notehub_py
from notehub_py.models.get_device_public_key200_response import GetDevicePublicKey200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_response = api_instance.get_device_public_key(project_uid, device_uid)
print("The response of DeviceApi->get_device_public_key:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_device_public_key: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str |
get_device_sessions
Get Device Sessions
Example
import notehub_py
from notehub_py.models.get_device_sessions200_response import GetDeviceSessions200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
page_size = 50 # int | (optional) (default to 50)
page_num = 1 # int | (optional) (default to 1)
try:
api_response = api_instance.get_device_sessions(project_uid, device_uid, page_size=page_size, page_num=page_num)
print("The response of DeviceApi->get_device_sessions:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_device_sessions: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
page_size | int | [optional] [default to 50] | |
page_num | int | [optional] [default to 1] |
Return type
Successful 200 get_device_sessions response
get_project_device_public_keys
Get Device Public Keys of a Project
Example
import notehub_py
from notehub_py.models.get_project_device_public_keys200_response import GetProjectDevicePublicKeys200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(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_project_device_public_keys(project_uid, page_size=page_size, page_num=page_num)
print("The response of DeviceApi->get_project_device_public_keys:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_project_device_public_keys: %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] |
get_project_devices
Get Devices of a Project
Example
import notehub_py
from notehub_py.models.get_project_devices200_response import GetProjectDevices200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(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)
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
tag = ["tag_example"] # List[str] | Tag filter (optional)
serial_number = ["serial_number_example"] # List[str] | Serial number filter (optional)
fleet_uid = "fleet_uid_example" # str | (optional)
notecard_firmware = ["notecard_firmware_example"] # List[str] | Firmware version filter (optional)
location = ["location_example"] # List[str] | Location filter (optional)
host_firmware = ["host_firmware_example"] # List[str] | Host firmware filter (optional)
product_uid = ["product_uid_example"] # List[str] | (optional)
sku = ["sku_example"] # List[str] | SKU filter (optional)
try:
api_response = api_instance.get_project_devices(project_uid, page_size=page_size, page_num=page_num)
print("The response of DeviceApi->get_project_devices:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_project_devices: %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] | |
device_uid | List[str] | A Device UID. | [optional] |
tag | List[str] | Tag filter | [optional] |
serial_number | List[str] | Serial number filter | [optional] |
fleet_uid | str | [optional] | |
notecard_firmware | List[str] | Firmware version filter | [optional] |
location | List[str] | Location filter | [optional] |
host_firmware | List[str] | Host firmware filter | [optional] |
product_uid | List[str] | [optional] | |
sku | List[str] | SKU filter | [optional] |
Return type
Successful 200 get_project_devices response
get_project_fleet_devices
Get Devices of a Fleet within a Project
Example
import notehub_py
from notehub_py.models.get_project_devices200_response import GetProjectDevices200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
page_size = 50 # int | (optional) (default to 50)
page_num = 1 # int | (optional) (default to 1)
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
tag = ["tag_example"] # List[str] | Tag filter (optional)
serial_number = ["serial_number_example"] # List[str] | Serial number filter (optional)
notecard_firmware = ["notecard_firmware_example"] # List[str] | Firmware version filter (optional)
location = ["location_example"] # List[str] | Location filter (optional)
host_firmware = ["host_firmware_example"] # List[str] | Host firmware filter (optional)
product_uid = ["product_uid_example"] # List[str] | (optional)
sku = ["sku_example"] # List[str] | SKU filter (optional)
try:
api_response = api_instance.get_project_fleet_devices(project_uid, fleet_uid, page_size=page_size, page_num=page_num)
print("The response of DeviceApi->get_project_fleet_devices:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_project_fleet_devices: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
fleet_uid | str | ||
page_size | int | [optional] [default to 50] | |
page_num | int | [optional] [default to 1] | |
device_uid | List[str] | A Device UID. | [optional] |
tag | List[str] | Tag filter | [optional] |
serial_number | List[str] | Serial number filter | [optional] |
notecard_firmware | List[str] | Firmware version filter | [optional] |
location | List[str] | Location filter | [optional] |
host_firmware | List[str] | Host firmware filter | [optional] |
product_uid | List[str] | [optional] | |
sku | List[str] | SKU filter | [optional] |
Return type
Successful 200 get_project_fleet_devices response
handle_note_add
Adds a Note to a Notefile, creating the Notefile if it doesn't yet exist.
Example
import notehub_py
from notehub_py.models.note import Note
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
notefile_id = "notefile_id_example" # str |
note = notehub_py.Note() # Note | Body or payload of note to be added to the device
try:
api_instance.handle_note_add(project_uid, device_uid, notefile_id, note)
except Exception as e:
print("Exception when calling DeviceApi->handle_note_add: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
notefile_id | str | ||
note | Note | Body or payload of note to be added to the device |
Note Properties
Name | Type | Description | Notes |
---|---|---|---|
body | object | [optional] | |
payload | str | [optional] |
Return type
void (empty response body)
handle_note_changes
Incrementally retrieve changes within a specific Notefile.
Example
import notehub_py
from notehub_py.models.handle_note_changes200_response import HandleNoteChanges200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
notefile_id = "notefile_id_example" # str |
tracker = "tracker_example" # str | The change tracker ID. (optional)
max = 56 # int | The maximum number of Notes to return in the request. (optional)
start = True # bool | true to reset the tracker to the beginning. (optional)
stop = True # bool | true to delete the tracker. (optional)
deleted = True # bool | true to return deleted notes. (optional)
delete = True # bool | true to delete the notes returned by the request. (optional)
try:
api_response = api_instance.handle_note_changes(project_uid, device_uid, notefile_id, tracker=tracker, max=max, start=start, stop=stop, deleted=deleted, delete=delete)
print("The response of DeviceApi->handle_note_changes:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->handle_note_changes: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
notefile_id | str | ||
tracker | str | The change tracker ID. | [optional] |
max | int | The maximum number of Notes to return in the request. | [optional] |
start | bool | true to reset the tracker to the beginning. | [optional] |
stop | bool | true to delete the tracker. | [optional] |
deleted | bool | true to return deleted notes. | [optional] |
delete | bool | true to delete the notes returned by the request. | [optional] |
Return type
Successful 200 handle_note_changes response
handle_note_create_add
Adds a Note to a Notefile, creating the Notefile if it doesn't yet exist.
Example
import notehub_py
from notehub_py.models.note import Note
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
notefile_id = "notefile_id_example" # str |
note_id = "note_id_example" # str |
note = notehub_py.Note() # Note | Body or payload of note to be added to the device
try:
api_instance.handle_note_create_add(project_uid, device_uid, notefile_id, note_id, note)
except Exception as e:
print("Exception when calling DeviceApi->handle_note_create_add: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
notefile_id | str | ||
note_id | str | ||
note | Note | Body or payload of note to be added to the device |
Return type
void (empty response body)
handle_note_delete
Delete a note from a DB notefile
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
notefile_id = "notefile_id_example" # str |
note_id = "note_id_example" # str |
try:
api_instance.handle_note_delete(project_uid, device_uid, notefile_id, note_id)
except Exception as e:
print("Exception when calling DeviceApi->handle_note_delete: %s\n" % e)
Parameters
Return type
void (empty response body)
handle_note_get
Get a note from a DB notefile
Example
import notehub_py
from notehub_py.models.handle_note_get200_response import HandleNoteGet200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
notefile_id = "notefile_id_example" # str |
note_id = "note_id_example" # str |
delete = True # bool | Whether to delete the note from the DB notefile (optional)
deleted = True # bool | Whether to return deleted notes (optional)
try:
api_response = api_instance.handle_note_get(project_uid, device_uid, notefile_id, note_id, delete=delete, deleted=deleted)
print("The response of DeviceApi->handle_note_get:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->handle_note_get: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
notefile_id | str | ||
note_id | str | ||
delete | bool | Whether to delete the note from the DB notefile | [optional] |
deleted | bool | Whether to return deleted notes | [optional] |
Return type
Successful 200 handle_note_get response
handle_note_signal
Send a signal from Notehub to a Notecard.
Example
import notehub_py
from notehub_py.models.body import Body
from notehub_py.models.handle_note_signal200_response import HandleNoteSignal200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
body = notehub_py.Body() # Body | Body or payload of signal to be sent to the device
try:
api_response = api_instance.handle_note_signal(project_uid, device_uid, body)
print("The response of DeviceApi->handle_note_signal:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->handle_note_signal: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
body | Body | Body or payload of signal to be sent to the device |
Body Properties
Name | Type | Description | Notes |
---|---|---|---|
body | object | [optional] Example code: { "signal": "signal_example" } |
Return type
Successful 200 handle_note_signal Response
handle_note_update
Update a note in a DB notefile
Example
import notehub_py
from notehub_py.models.note import Note
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
notefile_id = "notefile_id_example" # str |
note_id = "note_id_example" # str |
note = notehub_py.Note() # Note | Body or payload of note to be added to the device
try:
api_instance.handle_note_update(project_uid, device_uid, notefile_id, note_id, note)
except Exception as e:
print("Exception when calling DeviceApi->handle_note_update: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
notefile_id | str | ||
note_id | str | ||
note | Note | Body or payload of note to be added to the device |
Note Properties
Name | Type | Description | Notes |
---|---|---|---|
body | object | [optional] | |
payload | str | [optional] |
Return type
void (empty response body)
handle_notefile_changes
Used to perform queries on a single or multiple files to determine if new Notes are available to read
Example
import notehub_py
from notehub_py.models.handle_notefile_changes200_response import HandleNotefileChanges200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
tracker = "tracker_example" # str | The change tracker ID. (optional)
files = ["file_1", "file_2"] # List[str] | One or more files to obtain change information from. (optional)
try:
api_response = api_instance.handle_notefile_changes(project_uid, device_uid, tracker=tracker, files=files)
print("The response of DeviceApi->handle_notefile_changes:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->handle_notefile_changes: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
tracker | str | The change tracker ID. | [optional] |
files | List[str] | One or more files to obtain change information from. | [optional] |
Return type
Successful 200 handle_notefile_changes response
handle_notefile_changes_pending
Returns info about file changes that are pending upload to Notehub or download to the Notecard.
Example
import notehub_py
from notehub_py.models.handle_notefile_changes_pending200_response import HandleNotefileChangesPending200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_response = api_instance.handle_notefile_changes_pending(project_uid, device_uid)
print("The response of DeviceApi->handle_notefile_changes_pending:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->handle_notefile_changes_pending: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str |
Return type
Successful 200 handle_notefile_changes_pending response
handle_notefile_delete
Deletes Notefiles and the Notes they contain.
Example
import notehub_py
from notehub_py.models.handle_notefile_delete_request import HandleNotefileDeleteRequest
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
files = ["file_1", "file_2", "file_3"] # List[str] |
handle_notefile_delete_request = notehub_py.HandleNotefileDeleteRequest(files) # HandleNotefileDeleteRequest |
try:
api_instance.handle_notefile_delete(project_uid, device_uid, handle_notefile_delete_request)
except Exception as e:
print("Exception when calling DeviceApi->handle_notefile_delete: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
handle_notefile_delete_request | HandleNotefileDeleteRequest |
HandleNotefileDeleteRequest Properties
Name | Type | Description | Notes |
---|---|---|---|
files | List[str] | One or more files to obtain change information from. | [optional] Example code: ["file_1", "file_2", "file_3"] |
Return type
void (empty response body)
post_provision_project_device
Provision Device for a Project
Example
import notehub_py
from notehub_py.models.post_provision_project_device_request import PostProvisionProjectDeviceRequest
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
project_device_props = {
"product_uid": "com.blues.example_product_uid",
"device_sn": "device_uid_1",
"fleet_uids": ["fleet_uid_1"]
}
post_provision_project_device_request = notehub_py.PostProvisionProjectDeviceRequest(project_device_props) # PostProvisionProjectDeviceRequest | Provision a device to a specific ProductUID, device serial number, or fleetUIDs
try:
api_response = api_instance.post_provision_project_device(project_uid, device_uid, post_provision_project_device_request)
print("The response of DeviceApi->post_provision_project_device:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->post_provision_project_device: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
post_provision_project_device_request | PostProvisionProjectDeviceRequest | Provision a device to a specific ProductUID |
PostProvisionProjectDeviceRequest Properties
Name | Type | Description | Notes |
---|---|---|---|
product_uid | str | The ProductUID that the device should use. | Example code: product_uid="com.blues.example_product_uid" |
device_sn | str | The serial number to assign to the device. | [optional] Example code: device_sn="device_uid_example" |
fleet_uids | List[str] | The fleetUIDs to provision the device to. | [optional] Example code: fleet_uids=["fleet_uid_1","fleet_uid_2"] |
Return type
void (empty response body)
put_device_environment_variables
Put environment variables of a device
Example
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
env_vars = {"key": "value"} # Dict[str, str] |
environment_variables = notehub_py.EnvironmentVariables(env_vars) # EnvironmentVariables | Environment variables to be added to the device
try:
api_response = api_instance.put_device_environment_variables(project_uid, device_uid, environment_variables)
print("The response of DeviceApi->put_device_environment_variables:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->put_device_environment_variables: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
environment_variables | EnvironmentVariables | Environment variables to be added to the device |
EnvironmentVariables Properties
Name | Type | Description | Notes |
---|---|---|---|
environment_variables | Dict[str, str] | Example code: {"key": "value"} |
Return type
Successful 200 put_device_environment_variables response
put_device_environment_variables_by_pin
Put environment variables of a device with device pin authorization
Example
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: pin
configuration.api_key["pin"] = os.environ["API_KEY"]
# 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.DeviceApi(api_client)
product_uid = "com.blues.bridge:sensors" # str |
device_uid = "device_uid_example" # str |
env_vars = {"key": "value"} # Dict[str, str] |
environment_variables = notehub_py.EnvironmentVariables(env_vars) # EnvironmentVariables | Environment variables to be added to the device
try:
api_response = api_instance.put_device_environment_variables_by_pin(product_uid, device_uid, environment_variables)
print("The response of DeviceApi->put_device_environment_variables_by_pin:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->put_device_environment_variables_by_pin: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
product_uid | str | ||
device_uid | str | ||
environment_variables | EnvironmentVariables | Environment variables to be added to the device |
EnvironmentVariables Properties
Name | Type | Description | Notes |
---|---|---|---|
environment_variables | Dict[str, str] | Example code: {"key": "value"} |
pin
Event API
Method | HTTP Request |
---|---|
get_fleet_events | GET /v1/projects/{projectUID}/fleets/{fleetUID}/events |
get_fleet_events_by_cursor | GET /v1/projects/{projectUID}/fleets/{fleetUID}/events-cursor |
get_project_events | GET /v1/projects/{projectUID}/events |
get_project_events_by_cursor | GET /v1/projects/{projectUID}/events-cursor |
get_route_logs_by_event | GET /v1/projects/{projectUID}/events/{eventUID}/route-logs |
get_fleet_events
Get Events of a Fleet
Example
import notehub_py
from notehub_py.models.get_project_events200_response import GetProjectEvents200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.EventApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
page_size = 50 # int | (optional) (default to 50)
page_num = 1 # int | (optional) (default to 1)
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
sort_by = "captured" # str | (optional) (default to "captured")
sort_order = "asc" # str | (optional) (default to "asc")
start_date = 1628631763 # int | Unix timestamp (optional)
end_date = 1657894210 # int | Unix timestamp (optional)
date_type = "captured" # str | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters (optional) (default to 'captured')
system_files_only = True # bool | (optional)
files = "_health.qo, data.qo" # str | (optional)
format = "json" # str | Response format (JSON or CSV) (optional) (default to 'json')
serial_number = ["serial_number_example"] # List[str] | Filter by Serial Number (optional)
session_uid = ["session_uid_example"] # List[str] | Filter by Session UID (optional)
event_uid = ["event_uid_example"] # List[str] | Filter by Event UID (optional)
select_fields = "select_fields_example" # str | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output. (optional)
try:
api_response = api_instance.get_fleet_events(project_uid, fleet_uid=fleet_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, date_type=date_type, system_files_only=system_files_only, files=files, format=format, serial_number=serial_number, session_uid=session_uid, event_uid=event_uid, select_fields=select_fields)
print("The response of EventApi->get_fleet_events:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_fleet_events: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
fleet_uid | str | ||
page_size | int | [optional] [default to 50] | |
page_num | int | [optional] [default to 1] | |
device_uid | List[str] | A Device UID. | [optional] |
sort_by | str | [optional] [default to "captured"] | |
sort_order | str | [optional] [default to "asc"] | |
start_date | int | Unix timestamp | [optional] |
end_date | int | Unix timestamp | [optional] |
date_type | str | Which date to filter on, either "captured" or "uploaded". This will apply to the startDate and endDate parameters | [optional] [default to "captured"] |
system_files_only | bool | [optional] | |
files | str | [optional] | |
format | str | Response format ("json" or "csv") | [optional] [default to "json"] |
serial_number | List[str] | Filter by Serial Number | [optional] |
session_uid | List[str] | Filter by Session UID | [optional] |
event_uid | List[str] | Filter by Event UID | [optional] |
select_fields | str | Comma-separated list of fields to include in the response (e.g., "field1,field2.subfield,field3"). | [optional] |
Return type
Successful 200 get_fleet_events response
get_fleet_events_by_cursor
Get Events of a Fleet by cursor
Example
import notehub_py
from notehub_py.models.get_project_events_by_cursor200_response import GetProjectEventsByCursor200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.EventApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
limit = 50 # int | (optional) (default to 50)
cursor = "cursor_example" # str | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. (optional)
sort_order = "asc" # str | (optional) (default to "asc")
system_files_only = True # bool | (optional)
files = "_health.qo, data.qo" # str | (optional)
device_uid = ["device_uid_example"] # str | A Device UID. (optional)
start_date = 1628631763 # int | Unix timestamp (optional)
end_date = 1657894210 # int | Unix timestamp (optional)
try:
api_response = api_instance.get_fleet_events_by_cursor(project_uid, fleet_uid, limit=limit, cursor=cursor, sort_order=sort_order, system_files_only=system_files_only, files=files, device_uid=device_uid, start_date=start_date, end_date=end_date)
print("The response of EventApi->get_fleet_events_by_cursor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_fleet_events_by_cursor: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
fleet_uid | str | ||
limit | int | [optional] [default to 50] | |
cursor | str | A cursor, which can be obtained from the next_cursor value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. | [optional] |
sort_order | str | [optional] [default to "asc"] | |
system_files_only | bool | [optional] | |
files | str | [optional] | |
device_uid | List[str] | A Device UID. | [optional] |
start_date | int | Unix timestamp | [optional] |
end_date | int | Unix timestamp | [optional] |
Return type
Successful 200 get_fleet_events_by_cursor response
get_project_events
Get Events of a Project
Example
import notehub_py
from notehub_py.models.get_project_events200_response import GetProjectEvents200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.EventApi(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)
device_uid = ['device_uid_example'] # List[str] | A Device UID. (optional)
sort_by = "captured" # str | (optional) (default to "captured")
sort_order = "asc" # str | (optional) (default to "asc")
start_date = 1628631763 # int | Unix timestamp (optional)
end_date = 1657894210 # int | Unix timestamp (optional)
date_type = "captured" # str | Which date to filter on, either 'captured' or 'uploaded'. This will apply to the startDate and endDate parameters (optional) (default to 'captured')
system_files_only = True # bool | (optional)
files = "_health.qo, data.qo" # str | (optional)
format = "json" # str | Response format (JSON or CSV) (optional) (default to 'json')
serial_number = ["serial_number_example"] # List[str] | Filter by Serial Number (optional)
fleet_uid = ["fleet_uid_example"] # List[str] | Filter by Fleet UID (optional)
session_uid = ["session_uid_example"] # List[str] | Filter by Session UID (optional)
event_uid = ["event_uid_example"] # List[str] | Filter by Event UID (optional)
select_fields ="select_fields_example" # str | Comma-separated list of fields to select from JSON payload (e.g., \"field1,field2.subfield,field3\"), this will reflect the columns in the CSV output. (optional)
try:
api_response = api_instance.get_project_events(project_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, date_type=date_type, system_files_only=system_files_only, files=files, format=format, serial_number=serial_number, fleet_uid=fleet_uid, session_uid=session_uid, event_uid=event_uid, select_fields=select_fields)
print("The response of EventApi->get_project_events:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_project_events: %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] | |
device_uid | List[str] | A Device UID. | [optional] |
sort_by | str | [optional] [default to "captured"] | |
sort_order | str | [optional] [default to "asc"] | |
start_date | int | Unix timestamp | [optional] |
end_date | int | Unix timestamp | [optional] |
date_type | str | Which date to filter on, either "captured" or "uploaded". This will apply to the startDate and endDate parameters | [optional] [default to "captured"] |
system_files_only | bool | [optional] | |
files | str | [optional] | |
format | str | Response format ("json" or "csv") | [optional] [default to "json"] |
serial_number | List[str] | Filter by Serial Number | [optional] |
fleet_uid | List[str] | Filter by Fleet UID | [optional] |
session_uid | List[str] | Filter by Session UID | [optional] |
event_uid | List[str] | Filter by Event UID | [optional] |
select_fields | str | Comma-separated list of fields to include in the response (e.g., "field1,field2.subfield,field3"). | [optional] |
Return type
Successful 200 get_project_events response
get_project_events_by_cursor
Get Events of a Project by cursor
Example
import notehub_py
from notehub_py.models.get_project_events_by_cursor200_response import GetProjectEventsByCursor200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.EventApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
limit = 50 # int | (optional) (default to 50)
cursor = "cursor_example" # str | A cursor, which can be obtained from the `next_cursor` value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. (optional)
sort_order = "asc" # str | (optional) (default to "asc")
system_files_only = True # bool | (optional)
files = "_health.qo, data.qo" # str | (optional)
fleet_uid = "fleet_uid_example" # str | (optional)
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
try:
api_response = api_instance.get_project_events_by_cursor(project_uid, limit=limit, cursor=cursor, sort_order=sort_order, system_files_only=system_files_only, files=files, fleet_uid=fleet_uid, device_uid=device_uid)
print("The response of EventApi->get_project_events_by_cursor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_project_events_by_cursor: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
limit | int | [optional] [default to 50] | |
cursor | str | A cursor, which can be obtained from the next_cursor value from a previous call to this endpoint. The results set returned will include this event as its first result if the given identifier is actually the UID of an event. If this event UID is not found, the parameter is ignored and the results set is the same as if the parameter was not included. | [optional] |
sort_order | str | [optional] [default to "asc"] | |
system_files_only | bool | [optional] | |
files | str | [optional] | |
fleet_uid | str | [optional] | |
device_uid | List[str] | A Device UID. | [optional] |
Return type
Successful 200 get_project_events_by_cursor response
get_route_logs_by_event
Get Route Logs by Event UID
Example
import notehub_py
from notehub_py.models.get_route_logs_by_route200_response_inner import GetRouteLogsByRoute200ResponseInner
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.EventApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
event_uid = "4506f411-dea6-44a0-9743-1130f57d7747" # str |
try:
api_response = api_instance.get_route_logs_by_event(project_uid, event_uid)
print("The response of EventApi->get_route_logs_by_event:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_route_logs_by_event: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
event_uid | str |
Return type
Successful 200 get_route_logs_by_event response
Monitor API
Method | HTTP Request |
---|---|
create_monitor | POST /v1/projects/{projectUID}/monitors |
delete_monitor | DELETE /v1/projects/{projectUID}/monitors/{monitorUID} |
get_monitor | GET /v1/projects/{projectUID}/monitors/{monitorUID} |
get_monitors | GET /v1/projects/{projectUID}/monitors |
update_monitor | PUT /v1/projects/{projectUID}/monitors/{monitorUID} |
create_monitor
Create a new Monitor
Example
import notehub_py
from notehub_py.models.create_monitor import CreateMonitor
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.MonitorApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
monitor_props = {
"name": "Monitor Name", # str |
"description": "Monitor Description", # str |
"source_type": "event", # str |
"disabled": False, # bool |
"alert": False, # bool |
"notefile_filter": ["data.qo"], # List[str] |
"source_selector": "temperature", # str |
"condition_type": "greater_than", # str |
"threshold": 100, # int |
"alert_routes": [
{
"email": "example@blues.com" # str |
}
],
"silenced": False, # bool |
"routing_cooldown_period": "5m0s", # str |
"per_device": False # bool |
}
create_monitor = notehub_py.CreateMonitor(monitor_props) # CreateMonitor | Body or payload of monitor to be created
try:
api_response = api_instance.create_monitor(project_uid, create_monitor)
print("The response of MonitorApi->create_monitor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MonitorApi->create_monitor: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
create_monitor | CreateMonitor | Body or payload of monitor to be created |
CreateMonitor Properties
Name | Type | Description | Notes |
---|---|---|---|
uid | str | [optional] | |
name | str | ||
description | str | ||
source_type | str | The type of source to monitor. Currently only "event" is supported. | [optional] |
disabled | bool | If True , the monitor will not be evaluated. | [optional] |
alert | bool | If True , the monitor is in alert state. | [optional] |
notefile_filter | List[str] | ||
fleet_filter | List[str] | [optional] | |
source_selector | str | A valid JSONata expression that selects the value to monitor from the source. It should return a single, numeric value. | [optional] |
condition_type | str | A comparison operation to apply to the value selected by the source_selector ["greater_than", "greater_than_or_equal_to", "less_than", "less_than_or_equal_to", "equal_to", "not_equal_to"] | [optional] |
threshold | int | The type of condition to apply to the value selected by the source_selector | [optional] |
alert_routes | List[MonitorAlertRoutes] | ||
last_routed_at | str | The last time the monitor was evaluated and routed. | [optional] |
silenced | bool | If True , alerts will be created, but no notifications will be sent. | [optional] |
routing_cooldown_period | str | The time period to wait before routing another event after the monitor has been triggered. It follows the format of a number followed by a time unit. | [optional] Example code: "5hr30m10s" for 5 hours, 30 minutes, 10 seconds. |
aggregate_function | str | Aggregate function to apply to the selected values before applying the condition. ["none", "sum", "average", "max", "min"] | [optional] |
aggregate_window | str | The time window to aggregate the selected values. It follows the format of a number followed by a time unit | [optional] Example code: "5hr30m10s" for 5 hours, 30 minutes, 10 seconds. |
per_device | bool | Only relevant when using an aggregate_function . If True , the monitor will be evaluated per device, rather than across the set of selected devices. If True then if a single device matches the specified criteria, and alert will be created, otherwise the aggregate function will be applied across all devices. | [optional] |
MonitorAlertRoutes Properties
Name | Type | Description | Notes |
---|---|---|---|
url | str | The URL of the Slack webhook. | [optional] Example code: { "url": "hooks.slack.com/...", "message_type": "text|blocks", "text": "Message text" } |
message_type | str | text or blocks | [optional] |
text | str | The text of the message, or the blocks definition | [optional] |
token | str | The bearer token for the Slack app. | [optional] Example code: { "token": "your_token", "channel": "CXXXXXXXX", "message_type": "text|blocks", "text": "Message text" } |
channel | str | The channel to send the message to. | [optional] |
str | Email Address | [optional] Example code: { email: "your.email@blues.com" } |
Return type
Successful 200 create_monitor response
delete_monitor
Delete Monitor
Example
import notehub_py
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.MonitorApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
monitor_uid = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad" # str |
try:
api_response = api_instance.delete_monitor(project_uid, monitor_uid)
print("The response of MonitorApi->delete_monitor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MonitorApi->delete_monitor: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
monitor_uid | str |
Return type
Successful 200 delete_monitor response
get_monitor
Get Monitor
Example
import notehub_py
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.MonitorApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
monitor_uid = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad" # str |
try:
api_response = api_instance.get_monitor(project_uid, monitor_uid)
print("The response of MonitorApi->get_monitor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MonitorApi->get_monitor: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
monitor_uid | str |
Return type
Successful 200 get_monitor response
get_monitors
Get list of defined Monitors
Example
import notehub_py
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.MonitorApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_monitors(project_uid)
print("The response of MonitorApi->get_monitors:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MonitorApi->get_monitors: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str |
Return type
Successful 200 get_monitors response
update_monitor
Update Monitor
Example
import notehub_py
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.MonitorApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
monitor_uid = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad" # str |
monitor_props = {
"name": "Monitor Name", # str |
"description": "Monitor Description", # str |
"source_type": "event", # str |
"disabled": False, # bool |
"alert": False, # bool |
"notefile_filter": ["data.qo"], # List[str] |
"source_selector": "temperature", # str |
"condition_type": "greater_than", # str |
"threshold": 100, # int |
"alert_routes": [
{
"email": "example@blues.com" # str |
}
],
"silenced": False, # bool |
"routing_cooldown_period": "5m0s", # str |
"per_device": False # bool |
}
monitor = notehub_py.Monitor(monitor_props) # Monitor | Body or payload of monitor to be created
try:
api_response = api_instance.update_monitor(project_uid, monitor_uid, monitor)
print("The response of MonitorApi->update_monitor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling MonitorApi->update_monitor: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
monitor_uid | str | ||
monitor | Monitor | Body or payload of monitor to be created |
Monitor Properties
Name | Type | Description | Notes |
---|---|---|---|
uid | str | [optional] | |
name | str | ||
description | str | ||
source_type | str | The type of source to monitor. Currently only "event" is supported. | [optional] |
disabled | bool | If True , the monitor will not be evaluated. | [optional] |
alert | bool | If True , the monitor is in alert state. | [optional] |
notefile_filter | List[str] | ||
fleet_filter | List[str] | [optional] | |
source_selector | str | A valid JSONata expression that selects the value to monitor from the source. It should return a single, numeric value. | [optional] |
condition_type | str | A comparison operation to apply to the value selected by the source_selector ["greater_than", "greater_than_or_equal_to", "less_than", "less_than_or_equal_to", "equal_to", "not_equal_to"] | [optional] |
threshold | int | The type of condition to apply to the value selected by the source_selector | [optional] |
alert_routes | List[MonitorAlertRoutes] | ||
last_routed_at | str | The last time the monitor was evaluated and routed. | [optional] |
silenced | bool | If True , alerts will be created, but no notifications will be sent. | [optional] |
routing_cooldown_period | str | The time period to wait before routing another event after the monitor has been triggered. It follows the format of a number followed by a time unit. | [optional] Example code: "5hr30m10s" for 5 hours, 30 minutes, 10 seconds. |
aggregate_function | str | Aggregate function to apply to the selected values before applying the condition. ["none", "sum", "average", "max", "min"] | [optional] |
aggregate_window | str | The time window to aggregate the selected values. It follows the format of a number followed by a time unit | [optional] Example code: "5hr30m10s" for 5 hours, 30 minutes, 10 seconds. |
per_device | bool | Only relevant when using an aggregate_function . If True , the monitor will be evaluated per device, rather than across the set of selected devices. If True then if a single device matches the specified criteria, and alert will be created, otherwise the aggregate function will be applied across all devices. | [optional] |
MonitorAlertRoutes Properties
Name | Type | Description | Notes |
---|---|---|---|
url | str | The URL of the Slack webhook. | [optional] Example code: { "url": "hooks.slack.com/...", "message_type": "text|blocks", "text": "Message text" } |
message_type | str | text or blocks | [optional] |
text | str | The text of the message, or the blocks definition | [optional] |
token | str | The bearer token for the Slack app. | [optional] Example code: { "token": "your_token", "channel": "CXXXXXXXX", "message_type": "text|blocks", "text": "Message text" } |
channel | str | The channel to send the message to. | [optional] |
str | Email Address | [optional] Example code: { email: "your.email@blues.com" } |
Return type
Successful 200 update_monitor response
Project API
Method | HTTP Request |
---|---|
clone_project | POST /v1/projects/{projectUID}/clone |
create_fleet | POST /v1/projects/{projectUID}/fleets |
create_product | POST /v1/projects/{projectUID}/products |
create_project | POST /v1/projects |
delete_device_fleets | DELETE /v1/projects/{projectUID}/devices/{deviceUID}/fleets |
delete_fleet | DELETE /v1/projects/{projectUID}/fleets/{fleetUID} |
delete_fleet_environment_variable | DELETE /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables/{key} |
delete_project | DELETE /v1/projects/{projectUID} |
delete_project_environment_variable | DELETE /v1/projects/{projectUID}/environment_variables/{key} |
dfu_action | POST /v1/projects/{projectUID}/dfu/{firmwareType}/{action} |
disable_global_transformation | POST /v1/projects/{projectUID}/global-transformation/disable |
enable_global_transformation | POST /v1/projects/{projectUID}/global-transformation/enable |
get_device_dfu_history | GET /v1/projects/{projectUID}/devices/{deviceUID}/dfu/{firmwareType}/history |
get_device_dfu_status | GET /v1/projects/{projectUID}/devices/{deviceUID}/dfu/{firmwareType}/status |
get_device_fleets | GET /v1/projects/{projectUID}/devices/{deviceUID}/fleets |
get_devices_dfu_history | GET /v1/projects/{projectUID}/dfu/{firmwareType}/history |
get_devices_dfu_status | GET /v1/projects/{projectUID}/dfu/{firmwareType}/status |
get_firmware_info | GET /v1/projects/{projectUID}/firmware |
get_fleet_environment_variables | GET /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables |
get_project | GET /v1/projects/{projectUID} |
get_project_by_product | GET /v1/products/\{productUID\}/project |
get_project_environment_variables | GET /v1/projects/{projectUID}/environment_variables |
get_project_fleets | GET /v1/projects/{projectUID}/fleets |
get_project_members | GET /v1/projects/{projectUID}/members |
get_project_products | GET /v1/projects/{projectUID}/products |
get_projects | GET /v1/projects |
put_device_fleets | PUT /v1/projects/{projectUID}/devices/{deviceUID}/fleets |
put_fleet_environment_variables | PUT /v1/projects/{projectUID}/fleets/{fleetUID}/environment_variables |
put_project_environment_variables | PUT /v1/projects/{projectUID}/environment_variables |
set_global_transformation | POST /v1/projects/{projectUID}/global-transformation |
update_fleet | PUT /v1/projects/{projectUID}/fleets/{fleetUID} |
clone_project
Clone a Project
Example
import notehub_py
from notehub_py.models.clone_project_request import CloneProjectRequest
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "project_uid_example" # str | The project UID to be cloned.
clone_project_props = {
"label": "label_example",
"billing_account_uid": "billing_account_uid_example",
"disable_clone_routes": True,
"disable_clone_fleets": True
}
clone_project_request = notehub_py.CloneProjectRequest(clone_project_props) # CloneProjectRequest | Project to be cloned
try:
api_response = api_instance.clone_project(project_uid, clone_project_request)
print("The response of ProjectApi->clone_project:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->clone_project: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | The project UID to be cloned. | |
clone_project_request | CloneProjectRequest | Project to be cloned |
CloneProjectRequest Properties
Name | Type | Description | Notes |
---|---|---|---|
label | str | The label for the project. | |
billing_account_uid | str | The billing account UID for the project. The caller of the API must be able to create projects within the billing account, otherwise an error will be returned. | |
disable_clone_routes | bool | Whether to disallow the cloning of the routes from the parent project. Default is False if not specified. | [optional] |
disable_clone_fleets | bool | Whether to disallow the cloning of the fleets from the parent project. Default is False if not specified. | [optional] |
Return type
Successful 200 clone_project response
create_fleet
Create Fleet
Example
import notehub_py
from notehub_py.models.create_fleet_request import CreateFleetRequest
from notehub_py.models.fleet import Fleet
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_label = "fleet_label_example" # str |
create_fleet_request = notehub_py.CreateFleetRequest(fleet_label) # CreateFleetRequest | Fleet to be added
try:
api_response = api_instance.create_fleet(project_uid, create_fleet_request)
print("The response of ProjectApi->create_fleet:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->create_fleet: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
create_fleet_request | CreateFleetRequest | Fleet to be added |
CreateFleetRequest Properties
Name | Type | Description | Notes |
---|---|---|---|
label | str | The label for the Fleet. | [optional] |
Return type
Successful 200 create_fleet response
create_product
Create Product within a Project
Example
import notehub_py
from notehub_py.models.create_product_request import CreateProductRequest
from notehub_py.models.product import Product
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
product_request_props = {
"product_uid": "product_uid_example",
"label": "label_example",
"auto_provision_fleets": [
"fleet_id_1",
"fleet_id_2"
],
"disable_devices_by_default": True
}
create_product_request = notehub_py.CreateProductRequest(product_request_props) # CreateProductRequest | Product to be created
try:
api_response = api_instance.create_product(project_uid, create_product_request)
print("The response of ProjectApi->create_product:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->create_product: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
create_product_request | CreateProductRequest | Product to be created |
CreateProductRequest Properties
Name | Type | Description | Notes |
---|---|---|---|
product_uid | str | The requested uid for the Product. Will be prefixed with the user's reversed email. | |
label | str | The label for the Product. | |
auto_provision_fleets | List[str] | [optional] | |
disable_devices_by_default | bool | If True , devices provisioned to this product will be automatically disabled by default. | [optional] |
Return type
Successful 200 create_product response
create_project
Create a Project
Example
import notehub_py
from notehub_py.models.create_project_request import CreateProjectRequest
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_request_props = {
"label": "label_example",
"billing_account_uid": "billing_account_uid_example"
}
create_project_request = notehub_py.CreateProjectRequest() # CreateProjectRequest | Project to be created
try:
api_response = api_instance.create_project(create_project_request)
print("The response of ProjectApi->create_project:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->create_project: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
create_project_request | CreateProjectRequest | Project to be created |
CreateProjectRequest Properties
Name | Type | Description | Notes |
---|---|---|---|
label | str | The label for the project. | |
billing_account_uid | str | The billing account UID for the project. The caller of the API must be able to create projects within the billing account, otherwise an error will be returned. |
Return type
Successful 200 create_project response
delete_device_fleets
Remove Device from Fleets
Example
import notehub_py
from notehub_py.models.delete_device_fleets_request import DeleteDeviceFleetsRequest
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
fleet_uids = [
"fleet_uid_1",
"fleet_uid_2"
]
delete_device_fleets_request = notehub_py.DeleteDeviceFleetsRequest(fleet_uids) # DeleteDeviceFleetsRequest | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
try:
api_response = api_instance.delete_device_fleets(project_uid, device_uid, delete_device_fleets_request)
print("The response of ProjectApi->delete_device_fleets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->delete_device_fleets: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
delete_device_fleets_request | DeleteDeviceFleetsRequest | The fleets to remove from the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. |
DeleteDeviceFleetsRequest Properties
Name | Type | Description | Notes |
---|---|---|---|
fleet_uids | List[str] | The fleetUIDs to remove from the device. |
Return type
Successful 200 delete_device_fleets response
delete_fleet
Delete Fleet
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
try:
api_instance.delete_fleet(project_uid, fleet_uid)
except Exception as e:
print("Exception when calling ProjectApi->delete_fleet: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
fleet_uid | str |
Return type
void (empty response body)
delete_fleet_environment_variable
Delete environment variables of a fleet
Example
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
key = "key_example" # str | The environment variable key to delete.
try:
api_response = api_instance.delete_fleet_environment_variable(project_uid, fleet_uid, key)
print("The response of ProjectApi->delete_fleet_environment_variable:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->delete_fleet_environment_variable: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
fleet_uid | str | ||
key | str | The environment variable key to delete. |
Return type
Successful 200 delete_fleet_environment_variable response
delete_project
Delete a Project by ProjectUID
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_instance.delete_project(project_uid)
except Exception as e:
print("Exception when calling ProjectApi->delete_project: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str |
Return type
void (empty response body)
delete_project_environment_variable
Delete an environment variable of a project by key
Example
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
key = "key_example" # str | The environment variable key to delete.
try:
api_response = api_instance.delete_project_environment_variable(project_uid, key)
print("The response of ProjectApi->delete_project_environment_variable:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->delete_project_environment_variable: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
key | str | The environment variable key to delete. |
Return type
Successful 200 delete_project_environment_variable response
dfu_action
Update/cancel host or notecard firmware updates
Example
import notehub_py
from notehub_py.models.dfu_action_request import DfuActionRequest
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
firmware_type = "firmware_type_example" # str |
action = "action_example" # str |
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
tag = ["tag_example"] # List[str] | Tag filter (optional)
serial_number = ["serial_number_example"] # List[str] | Serial number filter (optional)
fleet_uid = "fleet_uid_example" # str | (optional)
notecard_firmware = ["notecard_firmware_example"] # List[str] | Firmware version filter (optional)
location = ["location_example"] # List[str] | Location filter (optional)
host_firmware = ["host_firmware_example"] # List[str] | Host firmware filter (optional)
product_uid = ["product_uid_example"] # List[str] | (optional)
sku = ["sku_example"] # List[str] | SKU filter (optional)
dfu_action_request = notehub_py.DfuActionRequest() # DfuActionRequest | Which firmware in the case of an update action (optional)
try:
api_instance.dfu_action(project_uid, firmware_type, action, device_uid=device_uid, tag=tag, serial_number=serial_number, fleet_uid=fleet_uid, notecard_firmware=notecard_firmware, location=location, host_firmware=host_firmware, product_uid=product_uid, sku=sku, dfu_action_request=dfu_action_request)
except Exception as e:
print("Exception when calling ProjectApi->dfu_action: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
firmware_type | str | ||
action | str | ||
device_uid | [List[str]] | A Device UID. | [optional] |
tag | [List[str]] | Tag filter | [optional] |
serial_number | [List[str]] | Serial number filter | [optional] |
fleet_uid | str | [optional] | |
notecard_firmware | [List[str]] | Firmware version filter | [optional] |
location | [List[str]] | Location filter | [optional] |
host_firmware | [List[str]] | Host firmware filter | [optional] |
product_uid | [List[str]] | [optional] | |
sku | [List[str]] | SKU filter | [optional] |
dfu_action_request | DfuActionRequest | Which firmware in the case of an update action | [optional] |
DfuActionRequest Properties
Name | Type | Description | Notes |
---|---|---|---|
filename | str | The name of the firmware file | [optional] |
Return type
void (empty response body)
disable_global_transformation
Disable the project-level event JSONata transformation
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_instance.disable_global_transformation(project_uid)
except Exception as e:
print("Exception when calling ProjectApi->disable_global_transformation: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str |
Return type
void (empty response body)
enable_global_transformation
Enable the project-level event JSONata transformation
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_instance.enable_global_transformation(project_uid)
except Exception as e:
print("Exception when calling ProjectApi->enable_global_transformation: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str |
Return type
void (empty response body)
get_device_dfu_history
Get device DFU history for host or Notecard firmware
Example
import notehub_py
from notehub_py.models.device_dfu_history import DeviceDfuHistory
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
firmware_type = "firmware_type_example" # str |
try:
api_response = api_instance.get_device_dfu_history(project_uid, device_uid, firmware_type)
print("The response of ProjectApi->get_device_dfu_history:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_device_dfu_history: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
firmware_type | str |
Return type
Successful 200 get_device_dfu_history response
get_device_dfu_status
Get device DFU status for host or Notecard firmware
Example
import notehub_py
from notehub_py.models.device_dfu_status import DeviceDfuStatus
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
firmware_type = "firmware_type_example" # str |
try:
api_response = api_instance.get_device_dfu_status(project_uid, device_uid, firmware_type)
print("The response of ProjectApi->get_device_dfu_status:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_device_dfu_status: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
firmware_type | str |
Return type
Successful 200 get_device_dfu_status response
get_device_fleets
Get Device Fleets
Example
import notehub_py
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
try:
api_response = api_instance.get_device_fleets(project_uid, device_uid)
print("The response of ProjectApi->get_device_fleets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_device_fleets: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str |
Return type
Successful 200 get_device_fleets response
get_devices_dfu_history
Get host or Notecard DFU history for all devices that match the filter criteria
Example
import notehub_py
from notehub_py.models.device_dfu_history_page import DeviceDfuHistoryPage
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
firmware_type = "firmware_type_example" # str |
page_size = 50 # int | (optional) (default to 50)
page_num = 1 # int | (optional) (default to 1)
sort_by = "captured" # str | (optional) (default to "captured")
sort_order = "asc" # str | (optional) (default to "asc")
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
tag = ["tag_example"] # List[str] | Tag filter (optional)
serial_number = ["serial_number_example"] # List[str] | Serial number filter (optional)
fleet_uid = "fleet_uid_example" # str | (optional)
notecard_firmware = ["notecard_firmware_example"] # List[str] | Firmware version filter (optional)
location = ["location_example"] # List[str] | Location filter (optional)
host_firmware = ["host_firmware_example"] # List[str] | Host firmware filter (optional)
product_uid = ["product_uid_example"] # List[str] | (optional)
sku = ["sku_example"] # List[str] | SKU filter (optional)
try:
api_response = api_instance.get_devices_dfu_history(project_uid, firmware_type, page_size=page_size, page_num=page_num, sort_by=sort_by, sort_order=sort_order, device_uid=device_uid, tag=tag, serial_number=serial_number, fleet_uid=fleet_uid, notecard_firmware=notecard_firmware, location=location, host_firmware=host_firmware, product_uid=product_uid, sku=sku)
print("The response of ProjectApi->get_devices_dfu_history:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_devices_dfu_history: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
firmware_type | str | ||
page_size | int | [optional] [default to 50] | |
page_num | int | [optional] [default to 1] | |
sort_by | str | [optional] [default to "captured"] | |
sort_order | str | [optional] [default to "asc"] | |
device_uid | [List[str]] | A Device UID. | [optional] |
tag | [List[str]] | Tag filter | [optional] |
serial_number | [List[str]] | Serial number filter | [optional] |
fleet_uid | str | [optional] | |
notecard_firmware | [List[str]] | Firmware version filter | [optional] |
location | [List[str]] | Location filter | [optional] |
host_firmware | [List[str]] | Host firmware filter | [optional] |
product_uid | [List[str]] | [optional] | |
sku | [List[str]] | SKU filter | [optional] |
Return type
Successful 200 get_devices_dfu_history response
get_devices_dfu_status
Get host or Notecard DFU history for all devices that match the filter criteria
Example
import notehub_py
from notehub_py.models.device_dfu_status_page import DeviceDfuStatusPage
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
firmware_type = "firmware_type_example" # str |
page_size = 50 # int | (optional) (default to 50)
page_num = 1 # int | (optional) (default to 1)
sort_by = "captured" # str | (optional) (default to "captured")
sort_order = "asc" # str | (optional) (default to "asc")
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
tag = ["tag_example"] # List[str] | Tag filter (optional)
serial_number = ["serial_number_example"] # List[str] | Serial number filter (optional)
fleet_uid = "fleet_uid_example" # str | (optional)
notecard_firmware = ["notecard_firmware_example"] # List[str] | Firmware version filter (optional)
location = ["location_example"] # List[str] | Location filter (optional)
host_firmware = ["host_firmware_example"] # List[str] | Host firmware filter (optional)
product_uid = ["product_uid_example"] # List[str] | (optional)
sku = ["sku_example"] # List[str] | SKU filter (optional)
try:
api_response = api_instance.get_devices_dfu_status(project_uid, firmware_type, page_size=page_size, page_num=page_num, sort_by=sort_by, sort_order=sort_order, device_uid=device_uid, tag=tag, serial_number=serial_number, fleet_uid=fleet_uid, notecard_firmware=notecard_firmware, location=location, host_firmware=host_firmware, product_uid=product_uid, sku=sku)
print("The response of ProjectApi->get_devices_dfu_status:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_devices_dfu_status: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
firmware_type | str | ||
page_size | int | [optional] [default to 50] | |
page_num | int | [optional] [default to 1] | |
sort_by | str | [optional] [default to "captured"] | |
sort_order | str | [optional] [default to "asc"] | |
device_uid | [List[str]] | A Device UID. | [optional] |
tag | [List[str]] | Tag filter | [optional] |
serial_number | [List[str]] | Serial number filter | [optional] |
fleet_uid | str | [optional] | |
notecard_firmware | [List[str]] | Firmware version filter | [optional] |
location | [List[str]] | Location filter | [optional] |
host_firmware | [List[str]] | Host firmware filter | [optional] |
product_uid | [List[str]] | [optional] | |
sku | [List[str]] | SKU filter | [optional] |
Return type
Successful 200 get_devices_dfu_status response
get_firmware_info
Get Available Firmware Information
Example
import notehub_py
from notehub_py.models.firmware_info import FirmwareInfo
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
product = "product_example" # str | (optional)
firmware_type = "firmware_type_example" # str | (optional)
version = "version_example" # str | (optional)
target = "target_example" # str | (optional)
filename = "notecard-7.2.2.16518$20240410043100.bin" # str | (optional)
md5 = "md5_example" # str | (optional)
unpublished = True # bool | (optional)
try:
api_response = api_instance.get_firmware_info(project_uid, product=product, firmware_type=firmware_type, version=version, target=target, filename=filename, md5=md5, unpublished=unpublished)
print("The response of ProjectApi->get_firmware_info:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_firmware_info: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
product | str | [optional] | |
firmware_type | str | [optional] | |
version | str | [optional] | |
target | str | [optional] | |
filename | str | [optional] | |
md5 | str | [optional] | |
unpublished | bool | [optional] |
get_fleet_environment_variables
Get environment variables of a fleet
Example
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
try:
api_response = api_instance.get_fleet_environment_variables(project_uid, fleet_uid)
print("The response of ProjectApi->get_fleet_environment_variables:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_fleet_environment_variables: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
fleet_uid | str |
Return type
Successful 200 get_fleet_environment_variables response
get_project
Get a Project by ProjectUID
Example
import notehub_py
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project(project_uid)
print("The response of ProjectApi->get_project:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str |
Return type
Successful 200 get_project response
get_project_by_product
Get a Project by ProductUID
Example
import notehub_py
from notehub_py.models.project import Project
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
product_uid = "com.blues.airnote" # str |
try:
api_response = api_instance.get_project_by_product(product_uid)
print("The response of ProjectApi->get_project_by_product:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project_by_product: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str |
Return type
Successful 200 get_project_by_product response
get_project_environment_variables
Get environment variables of a project
Example
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project_environment_variables(project_uid)
print("The response of ProjectApi->get_project_environment_variables:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project_environment_variables: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str |
Return type
Successful 200 get_project_environment_variables response
get_project_fleets
Get Project Fleets
Example
import notehub_py
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project_fleets(project_uid)
print("The response of ProjectApi->get_project_fleets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project_fleets: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str |
Return type
Successful 200 get_project_fleets response
get_project_members
Get Project Members
Example
import notehub_py
from notehub_py.models.get_project_members200_response import GetProjectMembers200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project_members(project_uid)
print("The response of ProjectApi->get_project_members:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project_members: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str |
Return type
Successful 200 get_project_members response
get_project_products
Get Products within a Project
Example
import notehub_py
from notehub_py.models.get_project_products200_response import GetProjectProducts200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project_products(project_uid)
print("The response of ProjectApi->get_project_products:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_project_products: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str |
Return type
Successful 200 get_project_products response
get_projects
Get Projects accessible by the api_key
Example
import notehub_py
from notehub_py.models.get_projects200_response import GetProjects200Response
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
try:
api_response = api_instance.get_projects()
print("The response of ProjectApi->get_projects:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_projects: %s\n" % e)
Parameters
This endpoint does not need any parameter.
Return type
Successful 200 get_projects response
put_device_fleets
Add Device to Fleets
Example
import notehub_py
from notehub_py.models.get_project_fleets200_response import GetProjectFleets200Response
from notehub_py.models.put_device_fleets_request import PutDeviceFleetsRequest
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "device_uid_example" # str |
fleet_uids = ["fleet_uid_1", "fleet_uid_2"] # List[str] | An array of Fleet UIDs.
put_device_fleets_request = notehub_py.PutDeviceFleetsRequest(fleet_uids) # PutDeviceFleetsRequest | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error.
try:
api_response = api_instance.put_device_fleets(project_uid, device_uid, put_device_fleets_request)
print("The response of ProjectApi->put_device_fleets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->put_device_fleets: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
device_uid | str | ||
put_device_fleets_request | PutDeviceFleetsRequest | The fleets to add to the device. Note that the endpoint takes an array of fleetUIDs, to facilitate multi-fleet devices. Multi-fleet is not yet enabled on all SaaS plans - unless it is supported by the SaaS plan of the project, passing more than a single fleetUID in the array is an error. |
PutDeviceFleetsRequest Properties
Name | Type | Description | Notes |
---|---|---|---|
fleet_uids | List[str] | The fleetUIDs to remove from the device. |
Return type
Successful 200 put_device_fleets response
put_fleet_environment_variables
Put environment variables of a fleet
Example
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
env_vars = {"key_1": "value_1", "key_2": "value_2"} # Dict[str, str] |
environment_variables = notehub_py.EnvironmentVariables(env_vars) # EnvironmentVariables | Environment variables to be added to the fleet
try:
api_response = api_instance.put_fleet_environment_variables(project_uid, fleet_uid, environment_variables)
print("The response of ProjectApi->put_fleet_environment_variables:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->put_fleet_environment_variables: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
fleet_uid | str | ||
environment_variables | EnvironmentVariables | Environment variables to be added to the fleet |
EnvironmentVariables Properties
Name | Type | Description | Notes |
---|---|---|---|
environment_variables | Dict[str, str] |
Return type
Successful 200 put_fleet_environment_variables response
put_project_environment_variables
Put environment variables of a project
Example
import notehub_py
from notehub_py.models.environment_variables import EnvironmentVariables
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
env_vars = {"key_1": "value_1", "key_2": "value_2"} # Dict[str, str] |
environment_variables = notehub_py.EnvironmentVariables(env_vars) # EnvironmentVariables | (optional)
try:
api_response = api_instance.put_project_environment_variables(project_uid, environment_variables=environment_variables)
print("The response of ProjectApi->put_project_environment_variables:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->put_project_environment_variables: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
environment_variables | EnvironmentVariables | Environment variables to be added to the fleet |
EnvironmentVariables Properties
Name | Type | Description | Notes |
---|---|---|---|
environment_variables | Dict[str, str] |
Return type
Successful 200 put_project_environment_variables response
set_global_transformation
Set the project-level event JSONata transformation
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
body = None # object | JSONata expression which will be applied to each event before it is persisted and routed
try:
api_instance.set_global_transformation(project_uid, body)
except Exception as e:
print("Exception when calling ProjectApi->set_global_transformation: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
body | object | JSONata expression which will be applied to each event before it is persisted and routed |
Return type
void (empty response body)
update_fleet
Update Fleet
Example
import notehub_py
from notehub_py.models.fleet import Fleet
from notehub_py.models.update_fleet_request import UpdateFleetRequest
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.ProjectApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
fleet_request_properties = {
"label": "fleet_label_1",
"add_devices": ["device_uid_1", "device_uid_2"],
"remove_devices": ["device_uid_3", "device_uid_4"]
}
update_fleet_request = notehub_py.UpdateFleetRequest(fleet_request_properties) # UpdateFleetRequest | Fleet details to update
try:
api_response = api_instance.update_fleet(project_uid, fleet_uid, update_fleet_request)
print("The response of ProjectApi->update_fleet:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->update_fleet: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
fleet_uid | str | ||
update_fleet_request | UpdateFleetRequest | Fleet details to update |
UpdateFleetRequest Properties
Name | Type | Description | Notes |
---|---|---|---|
label | str | The label for the Fleet. | [optional] Code example:* { "label": "Fleet Label", "add_devices": ["device_id_1", "device_id_2"], "remove_devices": ["device_id_3", "device_id_4"] } |
add_devices | List[str] | List of DeviceUIDs to add to fleet | [optional] |
remove_devices | List[str] | List of DeviceUIDs to remove from fleet | [optional] |
Return type
Successful 200 update_fleet response
Route API
Method | HTTP Request |
---|---|
create_route | POST /v1/projects/{projectUID}/routes |
delete_route | DELETE /v1/projects/{projectUID}/routes/{routeUID} |
get_route | GET /v1/projects/{projectUID}/routes/{routeUID} |
get_route_logs_by_route | GET /v1/projects/{projectUID}/routes/{routeUID}/route-logs |
get_routes | GET /v1/projects/{projectUID}/routes |
update_route | PUT /v1/projects/{projectUID}/routes/{routeUID} |
create_route
Create Route within a Project
Example
import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
notehub_route = {
"label": "Route Label",
"type":"http",
"http": {
"fleets": ["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],
"throttle_ms": 100,
"url": "http://route.url"
}
}
# NotehubRoute | Route to be Created
try:
api_response = api_instance.create_route(project_uid, notehub_route)
print("The response of RouteApi->create_route:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->create_route: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
notehub_route | NotehubRoute | Route to be Created |
NotehubRoute Properties
Name | Type | Description | Notes |
---|---|---|---|
uid | str | Route UID | [optional] |
label | str | Route Label | [optional] |
route_type | str | Type of route. | [optional] [default to "http"] |
modified | str | Last Modified | [optional] |
disabled | bool | Is route disabled? | [optional] [default to False ] |
var_schema | NotehubRouteSchema | [optional] |
NotehubRouteSchema Properties
Name | Type | Description | Notes |
---|---|---|---|
fleets | List[str] | list of Fleet UIDs to apply route to, if any. If empty, applies to all Fleets | [optional] |
filter | HttpFilter | [optional] | |
transform | SnowflakeTransform | [optional] | |
throttle_ms | int | Minimum time between requests in Miliseconds | [optional] |
url | str | [optional] | |
http_headers | Dict[str, str] | [optional] | |
disable_http_headers | bool | [optional] [default to False ] | |
timeout | int | Timeout in seconds for each request | [optional] [default to 15] |
token | str | Optional authentication token | [optional] |
alias | str | [optional] | |
broker | str | [optional] | |
port | int | [optional] | |
username | str | [optional] | |
password | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
topic | str | [optional] | |
certificate | str | Certificate with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
certificate_name | str | Name of certificate. | [optional] |
key | str | Key with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
private_key_name | str | Name of PEM key. If omitted, defaults to "present" | [optional] [default to 'present'] |
region | str | [optional] | |
access_key_id | str | [optional] | |
access_key_secret | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
message_group_id | str | [optional] | |
message_deduplication_id | str | [optional] | |
channel | str | The Channel ID for Bearer Token method, if the "slack-bearer" type is selected | [optional] |
test_api | bool | [optional] [default to False ] | |
data_feed_key | str | [optional] | |
client_id | str | [optional] | |
client_secret | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
functions_key_secret | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
sas_policy_name | str | [optional] | |
sas_policy_key | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
app_key | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
organization_name | str | [optional] | |
account_name | str | [optional] | |
user_name | str | [optional] | |
pem | str | PEM key with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
slack_type | str | The type of Slack message. Must be one of "slack-bearer for Bearer Token or "slack-webhook" for Webhook messages | [optional] |
bearer | str | The Bearer Token for Slack messaging, if the "slack-bearer" type is selected | [optional] |
webhook_url | str | The Webhook URL for Slack Messaging if the "slack-webhook" type is selected | [optional] |
text | str | The simple text message to be sent, if the blocks message field is not in use. Placeholders are available for this field. | [optional] |
blocks | str | The Blocks message to be sent. If populated, this field overrides the text field within the Slack Messaging API. Placeholders are available for this field. | [optional] |
HTTPFilter Properties
Name | Type | Description | Notes |
---|---|---|---|
type | str | What notefiles this route applies to. | [optional] |
system_notefiles | bool | Whether system notefiles should be affected by this route | [optional] |
files | List[str] | [optional] |
SnowflakeTransform Properties
Name | Type | Description | Notes |
---|---|---|---|
format | str | Data transformation to apply. Only "jsonata" is valid for Snowflake routes | [optional] [default to "jsonata"] |
jsonata | str | JSONata transformation | [optional] |
Return type
Successful 200 create_route response
delete_route
Delete single route within a project
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str |
try:
api_response = api_instance.delete_route(project_uid, route_uid)
print("The response of RouteApi->delete_route:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->delete_route: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
route_uid | str |
Return type
Successful 200 delete_route response
get_route
Get single route within a project
Example
import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str |
try:
api_response = api_instance.get_route(project_uid, route_uid)
print("The response of RouteApi->get_route:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->get_route: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
route_uid | str |
Return type
Successful 200 get_route response
get_route_logs_by_route
Get Route Logs by Route UID
Example
import notehub_py
from notehub_py.models.get_route_logs_by_route200_response_inner import GetRouteLogsByRoute200ResponseInner
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str |
page_size = 50 # int | (optional) (default to 50)
page_num = 1 # int | (optional) (default to 1)
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
sort_by = "captured" # str | (optional) (default to "captured")
sort_order = "asc" # str | (optional) (default to "asc")
start_date = 1628631763 # int | Unix timestamp (optional)
end_date = 1657894210 # int | Unix timestamp (optional)
system_files_only = True # bool | (optional)
files = "_health.qo, data.qo" # str | (optional)
try:
api_response = api_instance.get_route_logs_by_route(project_uid, route_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, sort_by=sort_by, sort_order=sort_order, start_date=start_date, end_date=end_date, system_files_only=system_files_only, files=files)
print("The response of RouteApi->get_route_logs_by_route:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->get_route_logs_by_route: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
route_uid | str | ||
page_size | int | [optional] [default to 50] | |
page_num | int | [optional] [default to 1] | |
device_uid | List[str] | A Device UID. | [optional] |
sort_by | str | [optional] [default to "captured"] | |
sort_order | str | [optional] [default to "asc"] | |
start_date | int | Unix timestamp | [optional] |
end_date | int | Unix timestamp | [optional] |
system_files_only | bool | [optional] | |
files | str | [optional] |
Return type
Successful 200 get_route_logs_by_route response
get_routes
Get all Routes within a Project
Example
import notehub_py
from notehub_py.models.user_db_route import UserDbRoute
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_routes(project_uid)
print("The response of RouteApi->get_routes:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->get_routes: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str |
Return type
Successful 200 get_routes response
update_route
Update route by UID
Example
import notehub_py
from notehub_py.models.notehub_route import NotehubRoute
from notehub_py.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.notefile.net
configuration = notehub_py.Configuration(
host = "https://api.notefile.net"
)
# Configure API key authorization: api_key
configuration.api_key["api_key"] = os.environ["API_KEY"]
# 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.RouteApi(api_client)
project_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
route_uid = "route:cbd20093cba58392c9f9bbdd0cdeb1a0" # str |
notehub_route = {
"http" {
"filter": {
"type": "include",
"system_notefiles": true,
"files": ["somefile.qo"],
},
"throttle_ms": 50,
"url": "http://new-route.url",
},
}
# NotehubRoute | Route settings to be updated
try:
api_response = api_instance.update_route(project_uid, route_uid, notehub_route)
print("The response of RouteApi->update_route:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RouteApi->update_route: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
project_uid | str | ||
route_uid | str | ||
notehub_route | Route | Route settings to be updated |
NotehubRoute Properties
Name | Type | Description | Notes |
---|---|---|---|
uid | str | Route UID | [optional] |
label | str | Route Label | [optional] |
route_type | str | Type of route. | [optional] [default to 'http'] |
modified | str | Last Modified | [optional] |
disabled | bool | Is route disabled? | [optional] [default to False ] |
var_schema | NotehubRouteSchema | [optional] |
NotehubRouteSchema Properties
Name | Type | Description | Notes |
---|---|---|---|
fleets | List[str] | list of Fleet UIDs to apply route to, if any. If empty, applies to all Fleets | [optional] |
filter | HttpFilter | [optional] | |
transform | SnowflakeTransform | [optional] | |
throttle_ms | int | Minimum time between requests in Miliseconds | [optional] |
url | str | [optional] | |
http_headers | Dict[str, str] | [optional] | |
disable_http_headers | bool | [optional] [default to False ] | |
timeout | int | Timeout in seconds for each request | [optional] [default to 15] |
token | str | Optional authentication token | [optional] |
alias | str | [optional] | |
broker | str | [optional] | |
port | int | [optional] | |
username | str | [optional] | |
password | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
topic | str | [optional] | |
certificate | str | Certificate with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
certificate_name | str | Name of certificate. | [optional] |
key | str | Key with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
private_key_name | str | Name of PEM key. If omitted, defaults to "present" | [optional] [default to 'present'] |
region | str | [optional] | |
access_key_id | str | [optional] | |
access_key_secret | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
message_group_id | str | [optional] | |
message_deduplication_id | str | [optional] | |
channel | str | The Channel ID for Bearer Token method, if the "slack-bearer" type is selected | [optional] |
test_api | bool | [optional] [default to False ] | |
data_feed_key | str | [optional] | |
client_id | str | [optional] | |
client_secret | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
functions_key_secret | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
sas_policy_name | str | [optional] | |
sas_policy_key | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
app_key | str | This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
organization_name | str | [optional] | |
account_name | str | [optional] | |
user_name | str | [optional] | |
pem | str | PEM key with \n newlines. This value is input-only and will be omitted from the response and replaced with a placeholder | [optional] |
slack_type | str | The type of Slack message. Must be one of "slack-bearer for Bearer Token or "slack-webhook" for Webhook messages | [optional] |
bearer | str | The Bearer Token for Slack messaging, if the "slack-bearer" type is selected | [optional] |
webhook_url | str | The Webhook URL for Slack Messaging if the "slack-webhook" type is selected | [optional] |
text | str | The simple text message to be sent, if the blocks message field is not in use. Placeholders are available for this field. | [optional] |
blocks | str | The Blocks message to be sent. If populated, this field overrides the text field within the Slack Messaging API. Placeholders are available for this field. | [optional] |
HTTPFilter Properties
Name | Type | Description | Notes |
---|---|---|---|
type | str | What notefiles this route applies to. | [optional] |
system_notefiles | bool | Whether system notefiles should be affected by this route | [optional] |
files | List[str] | [optional] |
SnowflakeTransform Properties
Name | Type | Description | Notes |
---|---|---|---|
format | str | Data transformation to apply. Only "jsonata" is valid for Snowflake routes | [optional] [default to "jsonata"] |
jsonata | str | JSONata transformation | [optional] |
Return type
Successful 200 update_route response