Notehub Py Library Overview
The Notehub Py library is a PyPI package built for Python applications. It provides a quick, Python-friendly way to connect to the Notehub API, and perform Notehub API requests with a clean, intuitive interface.
Installation
You can install the Notehub Py library in any Python application using the steps below.
In your project directory, run the following command from the terminal.
Using pip via PyPI:
python3 -m pip install notehub-pyOnce the package is installed, you can import it:
import notehub_pyUsage
Authentication
The Notehub Py library authenticates using a Personal Access Token (PAT). Pass your token via the Configuration object before making any API calls:
import notehub_py
configuration = notehub_py.Configuration(
access_token = "YOUR_ACCESS_TOKEN"
)Finding Your Project UID
Most API methods require a ProjectUID —
a unique identifier for your Notehub project in the format app:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. You can find it on your project's Settings page in Notehub.
Example: Fetching Events
Here's a complete example that retrieves the most recent events from a project:
import notehub_py
from pprint import pprint
configuration = notehub_py.Configuration(
access_token = "YOUR_ACCESS_TOKEN"
)
project_uid = "app:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
with notehub_py.ApiClient(configuration) as api_client:
api_instance = notehub_py.EventApi(api_client)
try:
response = api_instance.get_events(project_uid, page_size=10)
pprint(response)
except notehub_py.ApiException as e:
print(f"Error: {e}")Usage Limits
The Notehub API has usage limits. Exceeding the request threshold may result in 429 responses. See Notehub API Usage Limits for details.
API Reference
| API | Description |
|---|---|
| Billing Account API | Retrieve billing accounts accessible by your token |
| Device API | Manage devices, environment variables, and Notefiles |
| Event API | Query project and fleet events, with cursor and filter support |
| Jobs API | Manage and run Notehub batch jobs |
| Monitor API | Create and manage monitors that trigger alerts on event data |
| Project API | Manage projects, fleets, firmware, environment variables, and more |
| Route API | Create and manage routes for forwarding event data |
| Usage API | Query data, event, route log, and session usage by time range |
Billing Account API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| get_billing_account | GET /v1/billing-accounts/{billingAccountUID} | |
| get_billing_account_balance_history | GET /v1/billing-accounts/{billingAccountUID}/balance-history | |
| get_billing_accounts | GET /v1/billing-accounts |
get_billing_account
GetBillingAccount200Response get_billing_account(billing_account_uid)
Get Billing Account Information
Example
import notehub_py
from notehub_py.models.get_billing_account200_response import (
GetBillingAccount200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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)
billing_account_uid = "00000000-0000-0000-000000000001" # str |
try:
api_response = api_instance.get_billing_account(billing_account_uid)
print("The response of BillingAccountApi->get_billing_account:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BillingAccountApi->get_billing_account: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| billing_account_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_billing_account_balance_history
GetBillingAccountBalanceHistory200Response get_billing_account_balance_history(billing_account_uid, start_date=start_date, end_date=end_date)
Get Billing Account Balance history
Example
import notehub_py
from notehub_py.models.get_billing_account_balance_history200_response import (
GetBillingAccountBalanceHistory200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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)
billing_account_uid = "00000000-0000-0000-000000000001" # str |
start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional)
try:
api_response = api_instance.get_billing_account_balance_history(
billing_account_uid, start_date=start_date, end_date=end_date
)
print(
"The response of BillingAccountApi->get_billing_account_balance_history:\n"
)
pprint(api_response)
except Exception as e:
print(
"Exception when calling BillingAccountApi->get_billing_account_balance_history: %s\n"
% e
)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| billing_account_uid | str | ||
| start_date | int | Start date for filtering results, specified as a Unix timestamp | [optional] |
| end_date | int | End date for filtering results, specified as a Unix timestamp | [optional] |
Return type
GetBillingAccountBalanceHistory200Response
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_billing_accounts
GetBillingAccounts200Response 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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
Device API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| add_db_note | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | |
| add_qi_note | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID} | |
| create_notefile | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID} | |
| delete_device | DELETE /v1/projects/{projectOrProductUID}/devices/{deviceUID} | |
| delete_device_environment_variable | DELETE /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables/{key} | |
| delete_note | DELETE /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | |
| delete_notefiles | DELETE /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files | |
| disable_device | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable | |
| enable_device | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable | |
| get_db_note | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} | |
| get_device | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID} | |
| get_device_environment_hierarchy | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_hierarchy | Get environment variable hierarchy for a device |
| get_device_environment_variables | GET /v1/projects/{projectOrProductUID}/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/{projectOrProductUID}/devices/{deviceUID}/health-log | |
| get_device_latest_events | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest | |
| get_device_plans | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans | |
| get_device_public_key | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key | |
| get_device_public_keys | GET /v1/projects/{projectOrProductUID}/devices/public-keys | |
| get_device_sessions | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/sessions | |
| get_devices | GET /v1/projects/{projectOrProductUID}/devices | |
| get_fleet_devices | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/devices | |
| get_notefile | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID} | |
| list_notefiles | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files | |
| provision_device | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/provision | |
| set_device_environment_variables | PUT /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables | |
| set_device_environment_variables_by_pin | PUT /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin | |
| signal_device | POST /v1/projects/{projectOrProductUID}/devices/{deviceUID}/signal | |
| update_db_note | PUT /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID} |
add_db_note
add_db_note(project_or_product_uid, device_uid, notefile_id, note_id, note_input)
Add a Note to a .db notefile. if noteID is '-' then payload is ignored and empty notefile is created
Example
import notehub_py
from notehub_py.models.note_input import NoteInput
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
notefile_id = "notefile_id_example" # str |
note_id = "note_id_example" # str |
note_input = (
notehub_py.NoteInput()
) # NoteInput | Body or payload of note to be added to the device
try:
api_instance.add_db_note(
project_or_product_uid, device_uid, notefile_id, note_id, note_input
)
except Exception as e:
print("Exception when calling DeviceApi->add_db_note: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| notefile_id | str | ||
| note_id | str | ||
| note_input | NoteInput | Body or payload of note to be added to the device |
Return type
void (empty response body)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
add_qi_note
add_qi_note(project_or_product_uid, device_uid, notefile_id, note_input)
Adds a Note to a Notefile, creating the Notefile if it doesn't yet exist.
Example
import notehub_py
from notehub_py.models.note_input import NoteInput
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
notefile_id = "notefile_id_example" # str |
note_input = (
notehub_py.NoteInput()
) # NoteInput | Body or payload of note to be added to the device
try:
api_instance.add_qi_note(
project_or_product_uid, device_uid, notefile_id, note_input
)
except Exception as e:
print("Exception when calling DeviceApi->add_qi_note: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| notefile_id | str | ||
| note_input | NoteInput | Body or payload of note to be added to the device |
Return type
void (empty response body)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
create_notefile
create_notefile(project_or_product_uid, device_uid, notefile_id)
Creates an empty Notefile on the device.
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
notefile_id = "notefile_id_example" # str |
try:
api_instance.create_notefile(project_or_product_uid, device_uid, notefile_id)
except Exception as e:
print("Exception when calling DeviceApi->create_notefile: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| notefile_id | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
delete_device
delete_device(project_or_product_uid, device_uid)
Delete Device
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
try:
api_instance.delete_device(project_or_product_uid, device_uid)
except Exception as e:
print("Exception when calling DeviceApi->delete_device: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
delete_device_environment_variable
EnvironmentVariables delete_device_environment_variable(project_or_product_uid, device_uid, key)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
key = "key_example" # str | The environment variable key to delete.
try:
api_response = api_instance.delete_device_environment_variable(
project_or_product_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_or_product_uid | str | ||
| device_uid | str | ||
| key | str | The environment variable key to delete. |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
delete_note
delete_note(project_or_product_uid, device_uid, notefile_id, note_id)
Delete a note from a .db or .qi notefile
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
notefile_id = "notefile_id_example" # str |
note_id = "note_id_example" # str |
try:
api_instance.delete_note(
project_or_product_uid, device_uid, notefile_id, note_id
)
except Exception as e:
print("Exception when calling DeviceApi->delete_note: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| notefile_id | str | ||
| note_id | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
delete_notefiles
delete_notefiles(project_or_product_uid, device_uid, delete_notefiles_request)
Deletes Notefiles and the Notes they contain.
Example
import notehub_py
from notehub_py.models.delete_notefiles_request import DeleteNotefilesRequest
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
delete_notefiles_request = (
notehub_py.DeleteNotefilesRequest()
) # DeleteNotefilesRequest |
try:
api_instance.delete_notefiles(
project_or_product_uid, device_uid, delete_notefiles_request
)
except Exception as e:
print("Exception when calling DeviceApi->delete_notefiles: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| delete_notefiles_request | DeleteNotefilesRequest |
Return type
void (empty response body)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
disable_device
disable_device(project_or_product_uid, device_uid)
Disable Device
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
try:
api_instance.disable_device(project_or_product_uid, device_uid)
except Exception as e:
print("Exception when calling DeviceApi->disable_device: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
enable_device
enable_device(project_or_product_uid, device_uid)
Enable Device
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
try:
api_instance.enable_device(project_or_product_uid, device_uid)
except Exception as e:
print("Exception when calling DeviceApi->enable_device: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_db_note
GetDbNote200Response get_db_note(project_or_product_uid, device_uid, notefile_id, note_id, delete=delete, deleted=deleted)
Get a note from a .db or .qi notefile
Example
import notehub_py
from notehub_py.models.get_db_note200_response import GetDbNote200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # 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.get_db_note(
project_or_product_uid,
device_uid,
notefile_id,
note_id,
delete=delete,
deleted=deleted,
)
print("The response of DeviceApi->get_db_note:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_db_note: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_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
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device
Device get_device(project_or_product_uid, device_uid)
Get Device
Example
import notehub_py
from notehub_py.models.device import Device
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
try:
api_response = api_instance.get_device(project_or_product_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_or_product_uid | str | ||
| device_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_environment_hierarchy
EnvTreeJsonNode get_device_environment_hierarchy(project_or_product_uid, device_uid)
Get environment variable hierarchy for a device
Example
import notehub_py
from notehub_py.models.env_tree_json_node import EnvTreeJsonNode
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
try:
# Get environment variable hierarchy for a device
api_response = api_instance.get_device_environment_hierarchy(
project_or_product_uid, device_uid
)
print("The response of DeviceApi->get_device_environment_hierarchy:\n")
pprint(api_response)
except Exception as e:
print(
"Exception when calling DeviceApi->get_device_environment_hierarchy: %s\n"
% e
)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_environment_variables
GetDeviceEnvironmentVariablesByPin200Response get_device_environment_variables(project_or_product_uid, device_uid)
Get environment variables of a device
Example
import notehub_py
from notehub_py.models.get_device_environment_variables_by_pin200_response import (
GetDeviceEnvironmentVariablesByPin200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
try:
api_response = api_instance.get_device_environment_variables(
project_or_product_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_or_product_uid | str | ||
| device_uid | str |
Return type
GetDeviceEnvironmentVariablesByPin200Response
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_environment_variables_by_pin
GetDeviceEnvironmentVariablesByPin200Response get_device_environment_variables_by_pin(product_uid, device_uid, x_auth_token)
Get environment variables of a device with device pin authorization
Example
import notehub_py
from notehub_py.models.get_device_environment_variables_by_pin200_response import (
GetDeviceEnvironmentVariablesByPin200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint
# 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 = "dev:000000000000000" # str |
x_auth_token = (
"x_auth_token_example" # str | For accessing endpoints by Device pin.
)
try:
api_response = api_instance.get_device_environment_variables_by_pin(
product_uid, device_uid, x_auth_token
)
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 | ||
| x_auth_token | str | For accessing endpoints by Device pin. |
Return type
GetDeviceEnvironmentVariablesByPin200Response
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_health_log
GetDeviceHealthLog200Response get_device_health_log(project_or_product_uid, device_uid, start_date=start_date, end_date=end_date, log_type=log_type)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional)
log_type = [
"log_type_example"
] # List[str] | Return only specified log types (optional)
try:
api_response = api_instance.get_device_health_log(
project_or_product_uid,
device_uid,
start_date=start_date,
end_date=end_date,
log_type=log_type,
)
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_or_product_uid | str | ||
| device_uid | str | ||
| start_date | int | Start date for filtering results, specified as a Unix timestamp | [optional] |
| end_date | int | End date for filtering results, specified as a Unix timestamp | [optional] |
| log_type | List[str] | Return only specified log types | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_latest_events
GetDeviceLatestEvents200Response get_device_latest_events(project_or_product_uid, device_uid)
Get Device Latest Events
Example
import notehub_py
from notehub_py.models.get_device_latest_events200_response import (
GetDeviceLatestEvents200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
try:
api_response = api_instance.get_device_latest_events(
project_or_product_uid, device_uid
)
print("The response of DeviceApi->get_device_latest_events:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_device_latest_events: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str |
Return type
GetDeviceLatestEvents200Response
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_plans
GetDevicePlans200Response get_device_plans(project_or_product_uid, device_uid)
Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections.
Example
import notehub_py
from notehub_py.models.get_device_plans200_response import GetDevicePlans200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
try:
api_response = api_instance.get_device_plans(project_or_product_uid, device_uid)
print("The response of DeviceApi->get_device_plans:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_device_plans: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_public_key
GetDevicePublicKey200Response get_device_public_key(project_or_product_uid, device_uid)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
try:
api_response = api_instance.get_device_public_key(
project_or_product_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_or_product_uid | str | ||
| device_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_public_keys
GetDevicePublicKeys200Response get_device_public_keys(project_or_product_uid, page_size=page_size, page_num=page_num)
Get Device Public Keys of a Project
Example
import notehub_py
from notehub_py.models.get_device_public_keys200_response import (
GetDevicePublicKeys200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_device_public_keys(
project_or_product_uid, page_size=page_size, page_num=page_num
)
print("The response of DeviceApi->get_device_public_keys:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_device_public_keys: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| page_size | int | [optional] [default to 50] | |
| page_num | int | [optional] [default to 1] |
Return type
GetDevicePublicKeys200Response
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_sessions
GetDeviceSessions200Response get_device_sessions(project_or_product_uid, device_uid, page_size=page_size, page_num=page_num, start_date=start_date, end_date=end_date, first_sync=first_sync)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
page_size = 50 # int | (optional) (default to 50)
page_num = 1 # int | (optional) (default to 1)
start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional)
first_sync = False # bool | When true, filters results to only show first sync sessions (optional) (default to False)
try:
api_response = api_instance.get_device_sessions(
project_or_product_uid,
device_uid,
page_size=page_size,
page_num=page_num,
start_date=start_date,
end_date=end_date,
first_sync=first_sync,
)
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_or_product_uid | str | ||
| device_uid | str | ||
| page_size | int | [optional] [default to 50] | |
| page_num | int | [optional] [default to 1] | |
| start_date | int | Start date for filtering results, specified as a Unix timestamp | [optional] |
| end_date | int | End date for filtering results, specified as a Unix timestamp | [optional] |
| first_sync | bool | When true, filters results to only show first sync sessions | [optional] [default to False] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_devices
GetDevices200Response get_devices(project_or_product_uid, page_size=page_size, page_num=page_num, 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)
Get Devices of a Project
Example
import notehub_py
from notehub_py.models.get_devices200_response import GetDevices200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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"] # List[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(
project_or_product_uid,
page_size=page_size,
page_num=page_num,
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 DeviceApi->get_devices:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_devices: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_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 | List[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
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_fleet_devices
GetDevices200Response get_fleet_devices(project_or_product_uid, fleet_uid, page_size=page_size, page_num=page_num, device_uid=device_uid, tag=tag, serial_number=serial_number, notecard_firmware=notecard_firmware, location=location, host_firmware=host_firmware, product_uid=product_uid, sku=sku)
Get Devices of a Fleet within a Project
Example
import notehub_py
from notehub_py.models.get_devices200_response import GetDevices200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_fleet_devices(
project_or_product_uid,
fleet_uid,
page_size=page_size,
page_num=page_num,
device_uid=device_uid,
tag=tag,
serial_number=serial_number,
notecard_firmware=notecard_firmware,
location=location,
host_firmware=host_firmware,
product_uid=product_uid,
sku=sku,
)
print("The response of DeviceApi->get_fleet_devices:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_fleet_devices: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_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
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_notefile
GetNotefile200Response get_notefile(project_or_product_uid, device_uid, notefile_id, max=max, deleted=deleted, delete=delete)
For .qi files, returns the queued up notes. For .db files, returns all notes in the notefile
Example
import notehub_py
from notehub_py.models.get_notefile200_response import GetNotefile200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
notefile_id = "notefile_id_example" # str |
max = 56 # int | The maximum number of Notes to return in the request. (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.get_notefile(
project_or_product_uid,
device_uid,
notefile_id,
max=max,
deleted=deleted,
delete=delete,
)
print("The response of DeviceApi->get_notefile:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->get_notefile: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| notefile_id | str | ||
| max | int | The maximum number of Notes to return in the request. | [optional] |
| deleted | bool | true to return deleted notes. | [optional] |
| delete | bool | true to delete the notes returned by the request. | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
list_notefiles
List[Notefile] list_notefiles(project_or_product_uid, device_uid, files=files, pending=pending)
Lists .qi and .db files for the device
Example
import notehub_py
from notehub_py.models.notefile import Notefile
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
files = [
"files_example"
] # List[str] | One or more files to obtain change information from. (optional)
pending = (
True # bool | show only files that are pending sync to the Notecard (optional)
)
try:
api_response = api_instance.list_notefiles(
project_or_product_uid, device_uid, files=files, pending=pending
)
print("The response of DeviceApi->list_notefiles:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->list_notefiles: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| files | List[str] | One or more files to obtain change information from. | [optional] |
| pending | bool | show only files that are pending sync to the Notecard | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
provision_device
object provision_device(project_or_product_uid, device_uid, provision_device_request)
Provision Device for a Project
Example
import notehub_py
from notehub_py.models.provision_device_request import ProvisionDeviceRequest
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
provision_device_request = (
notehub_py.ProvisionDeviceRequest()
) # ProvisionDeviceRequest | Provision a device to a specific ProductUID
try:
api_response = api_instance.provision_device(
project_or_product_uid, device_uid, provision_device_request
)
print("The response of DeviceApi->provision_device:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->provision_device: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| provision_device_request | ProvisionDeviceRequest | Provision a device to a specific ProductUID |
Return type
object
HTTP request headers
- Content-Type: application/json
- Accept: application/json
set_device_environment_variables
EnvironmentVariables set_device_environment_variables(project_or_product_uid, device_uid, environment_variables)
Set 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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
environment_variables = (
notehub_py.EnvironmentVariables()
) # EnvironmentVariables | Environment variables to be added to the device
try:
api_response = api_instance.set_device_environment_variables(
project_or_product_uid, device_uid, environment_variables
)
print("The response of DeviceApi->set_device_environment_variables:\n")
pprint(api_response)
except Exception as e:
print(
"Exception when calling DeviceApi->set_device_environment_variables: %s\n"
% e
)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| environment_variables | EnvironmentVariables | Environment variables to be added to the device |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
set_device_environment_variables_by_pin
EnvironmentVariables set_device_environment_variables_by_pin(product_uid, device_uid, x_auth_token, environment_variables)
Set 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
# 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 = "dev:000000000000000" # str |
x_auth_token = (
"x_auth_token_example" # str | For accessing endpoints by Device pin.
)
environment_variables = (
notehub_py.EnvironmentVariables()
) # EnvironmentVariables | Environment variables to be added to the device
try:
api_response = api_instance.set_device_environment_variables_by_pin(
product_uid, device_uid, x_auth_token, environment_variables
)
print("The response of DeviceApi->set_device_environment_variables_by_pin:\n")
pprint(api_response)
except Exception as e:
print(
"Exception when calling DeviceApi->set_device_environment_variables_by_pin: %s\n"
% e
)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| product_uid | str | ||
| device_uid | str | ||
| x_auth_token | str | For accessing endpoints by Device pin. | |
| environment_variables | EnvironmentVariables | Environment variables to be added to the device |
Return type
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
signal_device
SignalDevice200Response signal_device(project_or_product_uid, device_uid, body)
Send a signal from Notehub to a Notecard.
Example
import notehub_py
from notehub_py.models.body import Body
from notehub_py.models.signal_device200_response import SignalDevice200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
body = (
notehub_py.Body()
) # Body | Body or payload of signal to be sent to the device
try:
api_response = api_instance.signal_device(
project_or_product_uid, device_uid, body
)
print("The response of DeviceApi->signal_device:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DeviceApi->signal_device: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| body | Body | Body or payload of signal to be sent to the device |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
update_db_note
update_db_note(project_or_product_uid, device_uid, notefile_id, note_id, note_input)
Update a note in a .db or .qi notefile
Example
import notehub_py
from notehub_py.models.note_input import NoteInput
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
notefile_id = "notefile_id_example" # str |
note_id = "note_id_example" # str |
note_input = (
notehub_py.NoteInput()
) # NoteInput | Body or payload of note to be added to the device
try:
api_instance.update_db_note(
project_or_product_uid, device_uid, notefile_id, note_id, note_input
)
except Exception as e:
print("Exception when calling DeviceApi->update_db_note: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| notefile_id | str | ||
| note_id | str | ||
| note_input | NoteInput | Body or payload of note to be added to the device |
Return type
void (empty response body)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
Event API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| get_events | GET /v1/projects/{projectOrProductUID}/events | |
| get_events_by_cursor | GET /v1/projects/{projectOrProductUID}/events-cursor | |
| get_fleet_events | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events | |
| get_fleet_events_by_cursor | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/events-cursor | |
| get_route_logs_by_event | GET /v1/projects/{projectOrProductUID}/events/{eventUID}/route-logs |
get_events
GetEvents200Response get_events(project_or_product_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)
Get Events of a Project
Example
import notehub_py
from notehub_py.models.get_events200_response import GetEvents200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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 | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a 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_events(
project_or_product_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_events:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_events: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_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 | Start date for filtering results, specified as a Unix timestamp | [optional] |
| end_date | int | End date for filtering results, specified as a 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 select from JSON payload (e.g., "field1,field2.subfield,field3"), this will reflect the columns in the CSV output. | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, text/csv
get_events_by_cursor
GetEventsByCursor200Response get_events_by_cursor(project_or_product_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)
Get Events of a Project by cursor
Example
import notehub_py
from notehub_py.models.get_events_by_cursor200_response import (
GetEventsByCursor200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_events_by_cursor(
project_or_product_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_events_by_cursor:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EventApi->get_events_by_cursor: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_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
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_fleet_events
GetEvents200Response get_fleet_events(project_or_product_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)
Get Events of a Fleet
Example
import notehub_py
from notehub_py.models.get_events200_response import GetEvents200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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 | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a 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_or_product_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_or_product_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 | Start date for filtering results, specified as a Unix timestamp | [optional] |
| end_date | int | End date for filtering results, specified as a 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 select from JSON payload (e.g., "field1,field2.subfield,field3"), this will reflect the columns in the CSV output. | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json, text/csv
get_fleet_events_by_cursor
GetEventsByCursor200Response get_fleet_events_by_cursor(project_or_product_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)
Get Events of a Fleet by cursor
Example
import notehub_py
from notehub_py.models.get_events_by_cursor200_response import (
GetEventsByCursor200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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"] # List[str] | A Device UID. (optional)
start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional)
try:
api_response = api_instance.get_fleet_events_by_cursor(
project_or_product_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_or_product_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 | Start date for filtering results, specified as a Unix timestamp | [optional] |
| end_date | int | End date for filtering results, specified as a Unix timestamp | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_route_logs_by_event
List[RouteLog] get_route_logs_by_event(project_or_product_uid, event_uid)
Get Route Logs by Event UID
Example
import notehub_py
from notehub_py.models.route_log import RouteLog
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_or_product_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_or_product_uid | str | ||
| event_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
Jobs API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| cancel_job_run | POST /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID}/cancel | |
| create_job | POST /v1/projects/{projectOrProductUID}/jobs | |
| delete_job | DELETE /v1/projects/{projectOrProductUID}/jobs/{jobUID} | |
| get_job | GET /v1/projects/{projectOrProductUID}/jobs/{jobUID} | |
| get_job_run | GET /v1/projects/{projectOrProductUID}/jobs/runs/{reportUID} | |
| get_job_runs | GET /v1/projects/{projectOrProductUID}/jobs/{jobUID}/runs | |
| get_jobs | GET /v1/projects/{projectOrProductUID}/jobs | |
| run_job | POST /v1/projects/{projectOrProductUID}/jobs/{jobUID}/run |
cancel_job_run
CancelJobRun200Response cancel_job_run(project_or_product_uid, report_uid)
Cancel a running job execution
Example
import notehub_py
from notehub_py.models.cancel_job_run200_response import CancelJobRun200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.JobsApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
report_uid = "my-reconciliation-job-1707654321000" # str | Unique identifier for a job run report
try:
api_response = api_instance.cancel_job_run(project_or_product_uid, report_uid)
print("The response of JobsApi->cancel_job_run:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling JobsApi->cancel_job_run: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| report_uid | str | Unique identifier for a job run report |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
create_job
CreateJob201Response create_job(project_or_product_uid, name, body)
Create a new batch job with an optional name
Example
import notehub_py
from notehub_py.models.create_job201_response import CreateJob201Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.JobsApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
name = "name_example" # str | Name for the job
body = None # object | The job definition as raw JSON
try:
api_response = api_instance.create_job(project_or_product_uid, name, body)
print("The response of JobsApi->create_job:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling JobsApi->create_job: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| name | str | Name for the job | |
| body | object | The job definition as raw JSON |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
delete_job
DeleteJob200Response delete_job(project_or_product_uid, job_uid)
Delete a batch job
Example
import notehub_py
from notehub_py.models.delete_job200_response import DeleteJob200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.JobsApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
job_uid = "my-reconciliation-job" # str | Unique identifier for a batch job
try:
api_response = api_instance.delete_job(project_or_product_uid, job_uid)
print("The response of JobsApi->delete_job:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling JobsApi->delete_job: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| job_uid | str | Unique identifier for a batch job |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_job
Job get_job(project_or_product_uid, job_uid)
Get a specific batch job definition
Example
import notehub_py
from notehub_py.models.job import Job
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.JobsApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
job_uid = "my-reconciliation-job" # str | Unique identifier for a batch job
try:
api_response = api_instance.get_job(project_or_product_uid, job_uid)
print("The response of JobsApi->get_job:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling JobsApi->get_job: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| job_uid | str | Unique identifier for a batch job |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_job_run
JobRun get_job_run(project_or_product_uid, report_uid)
Get the result of a job execution
Example
import notehub_py
from notehub_py.models.job_run import JobRun
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.JobsApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
report_uid = "my-reconciliation-job-1707654321000" # str | Unique identifier for a job run report
try:
api_response = api_instance.get_job_run(project_or_product_uid, report_uid)
print("The response of JobsApi->get_job_run:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling JobsApi->get_job_run: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| report_uid | str | Unique identifier for a job run report |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_job_runs
GetJobRuns200Response get_job_runs(project_or_product_uid, job_uid, status=status, dry_run=dry_run)
List all runs for a specific job
Example
import notehub_py
from notehub_py.models.get_job_runs200_response import GetJobRuns200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.JobsApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
job_uid = "my-reconciliation-job" # str | Unique identifier for a batch job
status = "status_example" # str | Filter runs by status (optional)
dry_run = True # bool | Filter runs by dry run flag (optional)
try:
api_response = api_instance.get_job_runs(
project_or_product_uid, job_uid, status=status, dry_run=dry_run
)
print("The response of JobsApi->get_job_runs:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling JobsApi->get_job_runs: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| job_uid | str | Unique identifier for a batch job | |
| status | str | Filter runs by status | [optional] |
| dry_run | bool | Filter runs by dry run flag | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_jobs
GetJobs200Response get_jobs(project_or_product_uid)
List all batch jobs for a project
Example
import notehub_py
from notehub_py.models.get_jobs200_response import GetJobs200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.JobsApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_jobs(project_or_product_uid)
print("The response of JobsApi->get_jobs:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling JobsApi->get_jobs: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
run_job
RunJob200Response run_job(project_or_product_uid, job_uid, dry_run=dry_run)
Execute a batch job
Example
import notehub_py
from notehub_py.models.run_job200_response import RunJob200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.JobsApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
job_uid = "my-reconciliation-job" # str | Unique identifier for a batch job
dry_run = False # bool | Run job in dry-run mode without making actual changes (optional) (default to False)
try:
api_response = api_instance.run_job(
project_or_product_uid, job_uid, dry_run=dry_run
)
print("The response of JobsApi->run_job:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling JobsApi->run_job: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| job_uid | str | Unique identifier for a batch job | |
| dry_run | bool | Run job in dry-run mode without making actual changes | [optional] [default to False] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
Monitor API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| create_monitor | POST /v1/projects/{projectOrProductUID}/monitors | |
| delete_monitor | DELETE /v1/projects/{projectOrProductUID}/monitors/{monitorUID} | |
| get_monitor | GET /v1/projects/{projectOrProductUID}/monitors/{monitorUID} | |
| get_monitors | GET /v1/projects/{projectOrProductUID}/monitors | |
| update_monitor | PUT /v1/projects/{projectOrProductUID}/monitors/{monitorUID} |
create_monitor
Monitor create_monitor(project_or_product_uid, body)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
body = notehub_py.Monitor() # Monitor | Body or payload of monitor to be created
try:
api_response = api_instance.create_monitor(project_or_product_uid, body)
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_or_product_uid | str | ||
| body | Monitor | Body or payload of monitor to be created |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
delete_monitor
Monitor delete_monitor(project_or_product_uid, monitor_uid)
Delete Monitor
Example
import notehub_py
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_or_product_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_or_product_uid | str | ||
| monitor_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_monitor
Monitor get_monitor(project_or_product_uid, monitor_uid)
Get Monitor
Example
import notehub_py
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_or_product_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_or_product_uid | str | ||
| monitor_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_monitors
List[Monitor] get_monitors(project_or_product_uid)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_monitors(project_or_product_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_or_product_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
update_monitor
Monitor update_monitor(project_or_product_uid, monitor_uid, monitor)
Update Monitor
Example
import notehub_py
from notehub_py.models.monitor import Monitor
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
monitor_uid = "monitor:8bAdf00d-000f-51c-af-01d5eaf00dbad" # str |
monitor = notehub_py.Monitor() # Monitor | Body or payload of monitor to be created
try:
api_response = api_instance.update_monitor(
project_or_product_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_or_product_uid | str | ||
| monitor_uid | str | ||
| monitor | Monitor | Body or payload of monitor to be created |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
Project API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| add_device_to_fleets | PUT /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | |
| clone_project | POST /v1/projects/{projectOrProductUID}/clone | |
| create_fleet | POST /v1/projects/{projectOrProductUID}/fleets | |
| create_product | POST /v1/projects/{projectOrProductUID}/products | |
| create_project | POST /v1/projects | |
| delete_device_from_fleets | DELETE /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | |
| delete_firmware | DELETE /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | |
| delete_fleet | DELETE /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | |
| delete_fleet_environment_variable | DELETE /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables/{key} | |
| delete_product | DELETE /v1/projects/{projectOrProductUID}/products/{productUID} | |
| delete_project | DELETE /v1/projects/{projectOrProductUID} | |
| delete_project_environment_variable | DELETE /v1/projects/{projectOrProductUID}/environment_variables/{key} | |
| disable_global_event_transformation | POST /v1/projects/{projectOrProductUID}/global-transformation/disable | |
| download_firmware | GET /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | |
| enable_global_event_transformation | POST /v1/projects/{projectOrProductUID}/global-transformation/enable | |
| get_aws_role_config | GET /v1/projects/{projectOrProductUID}/aws-role-config | Get AWS role configuration for role-based authentication |
| get_device_dfu_history | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/history | |
| get_device_dfu_status | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/dfu/{firmwareType}/status | |
| get_device_fleets | GET /v1/projects/{projectOrProductUID}/devices/{deviceUID}/fleets | |
| get_devices_dfu_history | GET /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/history | |
| get_devices_dfu_status | GET /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/status | |
| get_firmware_info | GET /v1/projects/{projectOrProductUID}/firmware | |
| get_fleet | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | |
| get_fleet_environment_hierarchy | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_hierarchy | Get environment variable hierarchy for a device |
| get_fleet_environment_variables | GET /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables | |
| get_fleets | GET /v1/projects/{projectOrProductUID}/fleets | |
| get_notefile_schemas | GET /v1/projects/{projectOrProductUID}/schemas | Get variable format for a notefile |
| get_products | GET /v1/projects/{projectOrProductUID}/products | |
| get_project | GET /v1/projects/{projectOrProductUID} | |
| get_project_by_product | GET /v1/products/{productUID}/project | |
| get_project_environment_hierarchy | GET /v1/projects/{projectOrProductUID}/environment_hierarchy | Get environment variable hierarchy for a device |
| get_project_environment_variables | GET /v1/projects/{projectOrProductUID}/environment_variables | |
| get_project_members | GET /v1/projects/{projectOrProductUID}/members | |
| get_projects | GET /v1/projects | |
| perform_dfu_action | POST /v1/projects/{projectOrProductUID}/dfu/{firmwareType}/{action} | |
| set_fleet_environment_variables | PUT /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/environment_variables | |
| set_global_event_transformation | POST /v1/projects/{projectOrProductUID}/global-transformation | |
| set_project_environment_variables | PUT /v1/projects/{projectOrProductUID}/environment_variables | |
| update_firmware | POST /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} | |
| update_fleet | PUT /v1/projects/{projectOrProductUID}/fleets/{fleetUID} | |
| upload_firmware | PUT /v1/projects/{projectOrProductUID}/firmware/{firmwareType}/{filename} |
add_device_to_fleets
GetDeviceFleets200Response add_device_to_fleets(project_or_product_uid, device_uid, add_device_to_fleets_request)
Add Device to Fleets
Example
import notehub_py
from notehub_py.models.add_device_to_fleets_request import AddDeviceToFleetsRequest
from notehub_py.models.get_device_fleets200_response import GetDeviceFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
add_device_to_fleets_request = (
notehub_py.AddDeviceToFleetsRequest()
) # AddDeviceToFleetsRequest | 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.add_device_to_fleets(
project_or_product_uid, device_uid, add_device_to_fleets_request
)
print("The response of ProjectApi->add_device_to_fleets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->add_device_to_fleets: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| add_device_to_fleets_request | AddDeviceToFleetsRequest | 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. |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
clone_project
Project clone_project(project_or_product_uid, clone_project_request)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
clone_project_request = (
notehub_py.CloneProjectRequest()
) # CloneProjectRequest | Project to be cloned
try:
api_response = api_instance.clone_project(
project_or_product_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_or_product_uid | str | ||
| clone_project_request | CloneProjectRequest | Project to be cloned |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
create_fleet
Fleet create_fleet(project_or_product_uid, create_fleet_request)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
create_fleet_request = (
notehub_py.CreateFleetRequest()
) # CreateFleetRequest | Fleet to be added
try:
api_response = api_instance.create_fleet(
project_or_product_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_or_product_uid | str | ||
| create_fleet_request | CreateFleetRequest | Fleet to be added |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
create_product
Product create_product(project_or_product_uid, create_product_request)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
create_product_request = (
notehub_py.CreateProductRequest()
) # CreateProductRequest | Product to be created
try:
api_response = api_instance.create_product(
project_or_product_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_or_product_uid | str | ||
| create_product_request | CreateProductRequest | Product to be created |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
create_project
Project create_project(create_project_request)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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)
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 |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
delete_device_from_fleets
GetDeviceFleets200Response delete_device_from_fleets(project_or_product_uid, device_uid, delete_device_from_fleets_request)
Remove Device from Fleets
Example
import notehub_py
from notehub_py.models.delete_device_from_fleets_request import (
DeleteDeviceFromFleetsRequest,
)
from notehub_py.models.get_device_fleets200_response import GetDeviceFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
delete_device_from_fleets_request = (
notehub_py.DeleteDeviceFromFleetsRequest()
) # DeleteDeviceFromFleetsRequest | 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_from_fleets(
project_or_product_uid, device_uid, delete_device_from_fleets_request
)
print("The response of ProjectApi->delete_device_from_fleets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->delete_device_from_fleets: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| device_uid | str | ||
| delete_device_from_fleets_request | DeleteDeviceFromFleetsRequest | 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. |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
delete_firmware
delete_firmware(project_or_product_uid, firmware_type, filename)
Delete a host firmware binary. The filename must be the full stored filename including the timestamp suffix (e.g. test$20260324190911.bin) as returned by the firmware upload or list endpoints.
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
firmware_type = "firmware_type_example" # str |
filename = "filename_example" # str |
try:
api_instance.delete_firmware(project_or_product_uid, firmware_type, filename)
except Exception as e:
print("Exception when calling ProjectApi->delete_firmware: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| firmware_type | str | ||
| filename | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
delete_fleet
delete_fleet(project_or_product_uid, fleet_uid)
Delete Fleet
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
try:
api_instance.delete_fleet(project_or_product_uid, fleet_uid)
except Exception as e:
print("Exception when calling ProjectApi->delete_fleet: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| fleet_uid | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
delete_fleet_environment_variable
EnvironmentVariables delete_fleet_environment_variable(project_or_product_uid, fleet_uid, key)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_or_product_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_or_product_uid | str | ||
| fleet_uid | str | ||
| key | str | The environment variable key to delete. |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
delete_product
delete_product(project_or_product_uid, product_uid)
Delete a product
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
product_uid = "com.blues.bridge:sensors" # str |
try:
api_instance.delete_product(project_or_product_uid, product_uid)
except Exception as e:
print("Exception when calling ProjectApi->delete_product: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| product_uid | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
delete_project
delete_project(project_or_product_uid)
Delete a Project by ProjectUID
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_instance.delete_project(project_or_product_uid)
except Exception as e:
print("Exception when calling ProjectApi->delete_project: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
delete_project_environment_variable
EnvironmentVariables delete_project_environment_variable(project_or_product_uid, key)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_or_product_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_or_product_uid | str | ||
| key | str | The environment variable key to delete. |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
disable_global_event_transformation
disable_global_event_transformation(project_or_product_uid)
Disable the project-level event JSONata transformation
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_instance.disable_global_event_transformation(project_or_product_uid)
except Exception as e:
print(
"Exception when calling ProjectApi->disable_global_event_transformation: %s\n"
% e
)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
download_firmware
bytearray download_firmware(project_or_product_uid, firmware_type, filename)
Download firmware binary
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
firmware_type = "firmware_type_example" # str |
filename = "filename_example" # str |
try:
api_response = api_instance.download_firmware(
project_or_product_uid, firmware_type, filename
)
print("The response of ProjectApi->download_firmware:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->download_firmware: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| firmware_type | str | ||
| filename | str |
Return type
bytearray
HTTP request headers
- Content-Type: Not defined
- Accept: application/octet-stream, application/json
enable_global_event_transformation
enable_global_event_transformation(project_or_product_uid)
Enable the project-level event JSONata transformation
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_instance.enable_global_event_transformation(project_or_product_uid)
except Exception as e:
print(
"Exception when calling ProjectApi->enable_global_event_transformation: %s\n"
% e
)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_aws_role_config
AWSRoleConfig get_aws_role_config(project_or_product_uid)
Get AWS role configuration for role-based authentication
Returns the AWS Account ID and External ID needed to configure an IAM role trust policy for role-based authentication on AWS routes.
Example
import notehub_py
from notehub_py.models.aws_role_config import AWSRoleConfig
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
# Get AWS role configuration for role-based authentication
api_response = api_instance.get_aws_role_config(project_or_product_uid)
print("The response of ProjectApi->get_aws_role_config:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_aws_role_config: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_dfu_history
DeviceDfuHistory get_device_dfu_history(project_or_product_uid, device_uid, firmware_type)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_or_product_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_or_product_uid | str | ||
| device_uid | str | ||
| firmware_type | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_dfu_status
DeviceDfuStatus get_device_dfu_status(project_or_product_uid, device_uid, firmware_type)
Get device DFU history 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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_or_product_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_or_product_uid | str | ||
| device_uid | str | ||
| firmware_type | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_device_fleets
GetDeviceFleets200Response get_device_fleets(project_or_product_uid, device_uid)
Get Device Fleets
Example
import notehub_py
from notehub_py.models.get_device_fleets200_response import GetDeviceFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
device_uid = "dev:000000000000000" # str |
try:
api_response = api_instance.get_device_fleets(
project_or_product_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_or_product_uid | str | ||
| device_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_devices_dfu_history
DeviceDfuHistoryPage get_devices_dfu_history(project_or_product_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)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_or_product_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_or_product_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
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_devices_dfu_status
DeviceDfuStatusPage get_devices_dfu_status(project_or_product_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)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_or_product_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_or_product_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
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_firmware_info
List[FirmwareInfo] get_firmware_info(project_or_product_uid, product=product, firmware_type=firmware_type, version=version, target=target, filename=filename, md5=md5, unpublished=unpublished, sort_by=sort_by, sort_order=sort_order)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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)
sort_by = "created" # str | Field to sort by (optional) (default to 'created')
sort_order = "desc" # str | Sort order (asc for ascending, desc for descending) (optional) (default to 'desc')
try:
api_response = api_instance.get_firmware_info(
project_or_product_uid,
product=product,
firmware_type=firmware_type,
version=version,
target=target,
filename=filename,
md5=md5,
unpublished=unpublished,
sort_by=sort_by,
sort_order=sort_order,
)
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_or_product_uid | str | ||
| product | str | [optional] | |
| firmware_type | str | [optional] | |
| version | str | [optional] | |
| target | str | [optional] | |
| filename | str | [optional] | |
| md5 | str | [optional] | |
| unpublished | bool | [optional] | |
| sort_by | str | Field to sort by | [optional] [default to 'created'] |
| sort_order | str | Sort order (asc for ascending, desc for descending) | [optional] [default to 'desc'] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_fleet
Fleet get_fleet(project_or_product_uid, fleet_uid)
Get Fleet
Example
import notehub_py
from notehub_py.models.fleet import Fleet
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
try:
api_response = api_instance.get_fleet(project_or_product_uid, fleet_uid)
print("The response of ProjectApi->get_fleet:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_fleet: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| fleet_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_fleet_environment_hierarchy
EnvTreeJsonNode get_fleet_environment_hierarchy(project_or_product_uid, fleet_uid)
Get environment variable hierarchy for a device
Example
import notehub_py
from notehub_py.models.env_tree_json_node import EnvTreeJsonNode
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
try:
# Get environment variable hierarchy for a device
api_response = api_instance.get_fleet_environment_hierarchy(
project_or_product_uid, fleet_uid
)
print("The response of ProjectApi->get_fleet_environment_hierarchy:\n")
pprint(api_response)
except Exception as e:
print(
"Exception when calling ProjectApi->get_fleet_environment_hierarchy: %s\n"
% e
)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| fleet_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_fleet_environment_variables
EnvironmentVariables get_fleet_environment_variables(project_or_product_uid, fleet_uid)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
try:
api_response = api_instance.get_fleet_environment_variables(
project_or_product_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_or_product_uid | str | ||
| fleet_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_fleets
GetDeviceFleets200Response get_fleets(project_or_product_uid)
Get Project Fleets
Example
import notehub_py
from notehub_py.models.get_device_fleets200_response import GetDeviceFleets200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_fleets(project_or_product_uid)
print("The response of ProjectApi->get_fleets:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_fleets: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_notefile_schemas
List[NotefileSchema] get_notefile_schemas(project_or_product_uid)
Get variable format for a notefile
Example
import notehub_py
from notehub_py.models.notefile_schema import NotefileSchema
from notehub_py.rest import ApiException
from pprint import pprint
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
# Get variable format for a notefile
api_response = api_instance.get_notefile_schemas(project_or_product_uid)
print("The response of ProjectApi->get_notefile_schemas:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_notefile_schemas: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str |
Return type
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_products
GetProducts200Response get_products(project_or_product_uid)
Get Products within a Project
Example
import notehub_py
from notehub_py.models.get_products200_response import GetProducts200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_products(project_or_product_uid)
print("The response of ProjectApi->get_products:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->get_products: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_project
Project get_project(project_or_product_uid)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project(project_or_product_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_or_product_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_project_by_product
Project get_project_by_product(product_uid)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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 |
|---|---|---|---|
| product_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_project_environment_hierarchy
EnvTreeJsonNode get_project_environment_hierarchy(project_or_product_uid)
Get environment variable hierarchy for a device
Example
import notehub_py
from notehub_py.models.env_tree_json_node import EnvTreeJsonNode
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
# Get environment variable hierarchy for a device
api_response = api_instance.get_project_environment_hierarchy(
project_or_product_uid
)
print("The response of ProjectApi->get_project_environment_hierarchy:\n")
pprint(api_response)
except Exception as e:
print(
"Exception when calling ProjectApi->get_project_environment_hierarchy: %s\n"
% e
)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_project_environment_variables
EnvironmentVariables get_project_environment_variables(project_or_product_uid)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project_environment_variables(
project_or_product_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_or_product_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_project_members
GetProjectMembers200Response get_project_members(project_or_product_uid)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
try:
api_response = api_instance.get_project_members(project_or_product_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_or_product_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_projects
GetProjects200Response 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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
perform_dfu_action
perform_dfu_action(project_or_product_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)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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.perform_dfu_action(
project_or_product_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->perform_dfu_action: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_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] |
Return type
void (empty response body)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
set_fleet_environment_variables
EnvironmentVariables set_fleet_environment_variables(project_or_product_uid, fleet_uid, environment_variables)
Set 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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
environment_variables = (
notehub_py.EnvironmentVariables()
) # EnvironmentVariables | Environment variables to be added to the fleet
try:
api_response = api_instance.set_fleet_environment_variables(
project_or_product_uid, fleet_uid, environment_variables
)
print("The response of ProjectApi->set_fleet_environment_variables:\n")
pprint(api_response)
except Exception as e:
print(
"Exception when calling ProjectApi->set_fleet_environment_variables: %s\n"
% e
)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| fleet_uid | str | ||
| environment_variables | EnvironmentVariables | Environment variables to be added to the fleet |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
set_global_event_transformation
set_global_event_transformation(project_or_product_uid, body)
Set the project-level event JSONata transformation
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_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_event_transformation(project_or_product_uid, body)
except Exception as e:
print(
"Exception when calling ProjectApi->set_global_event_transformation: %s\n"
% e
)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_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)
HTTP request headers
- Content-Type: application/json
- Accept: application/json
set_project_environment_variables
EnvironmentVariables set_project_environment_variables(project_or_product_uid, environment_variables=environment_variables)
Set 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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
environment_variables = (
notehub_py.EnvironmentVariables()
) # EnvironmentVariables | (optional)
try:
api_response = api_instance.set_project_environment_variables(
project_or_product_uid, environment_variables=environment_variables
)
print("The response of ProjectApi->set_project_environment_variables:\n")
pprint(api_response)
except Exception as e:
print(
"Exception when calling ProjectApi->set_project_environment_variables: %s\n"
% e
)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| environment_variables | EnvironmentVariables | [optional] |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
update_firmware
FirmwareInfo update_firmware(project_or_product_uid, firmware_type, filename, update_host_firmware_request)
Update the metadata of an existing host firmware entry. The filename must be the full stored filename including the timestamp suffix (e.g. test$20260324190911.bin) as returned by the firmware upload or list endpoints.
Example
import notehub_py
from notehub_py.models.firmware_info import FirmwareInfo
from notehub_py.models.update_host_firmware_request import UpdateHostFirmwareRequest
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
firmware_type = "firmware_type_example" # str |
filename = "filename_example" # str |
update_host_firmware_request = (
notehub_py.UpdateHostFirmwareRequest()
) # UpdateHostFirmwareRequest | Firmware metadata fields to update. All fields are optional; only provided fields will be updated.
try:
api_response = api_instance.update_firmware(
project_or_product_uid,
firmware_type,
filename,
update_host_firmware_request,
)
print("The response of ProjectApi->update_firmware:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->update_firmware: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| firmware_type | str | ||
| filename | str | ||
| update_host_firmware_request | UpdateHostFirmwareRequest | Firmware metadata fields to update. All fields are optional; only provided fields will be updated. |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
update_fleet
Fleet update_fleet(project_or_product_uid, fleet_uid, update_fleet_request)
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
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
fleet_uid = "fleet_uid_example" # str |
update_fleet_request = (
notehub_py.UpdateFleetRequest()
) # UpdateFleetRequest | Fleet details to update
try:
api_response = api_instance.update_fleet(
project_or_product_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_or_product_uid | str | ||
| fleet_uid | str | ||
| update_fleet_request | UpdateFleetRequest | Fleet details to update |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
upload_firmware
FirmwareInfo upload_firmware(project_or_product_uid, firmware_type, filename, body, version=version, notes=notes)
Upload firmware binary
Example
import notehub_py
from notehub_py.models.firmware_info import FirmwareInfo
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
firmware_type = "firmware_type_example" # str |
filename = "filename_example" # str |
body = None # bytearray | contents of the firmware binary
version = "version_example" # str | Firmware version (optional). If not provided, the version will be extracted from firmware binary if available, otherwise left empty (optional)
notes = "notes_example" # str | Optional notes describing what's different about this firmware version (optional)
try:
api_response = api_instance.upload_firmware(
project_or_product_uid,
firmware_type,
filename,
body,
version=version,
notes=notes,
)
print("The response of ProjectApi->upload_firmware:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ProjectApi->upload_firmware: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| firmware_type | str | ||
| filename | str | ||
| body | bytearray | contents of the firmware binary | |
| version | str | Firmware version (optional). If not provided, the version will be extracted from firmware binary if available, otherwise left empty | [optional] |
| notes | str | Optional notes describing what's different about this firmware version | [optional] |
Return type
HTTP request headers
- Content-Type: application/octet-stream
- Accept: application/json
Route API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| create_route | POST /v1/projects/{projectOrProductUID}/routes | |
| delete_route | DELETE /v1/projects/{projectOrProductUID}/routes/{routeUID} | |
| get_route | GET /v1/projects/{projectOrProductUID}/routes/{routeUID} | |
| get_route_logs_by_route | GET /v1/projects/{projectOrProductUID}/routes/{routeUID}/route-logs | |
| get_routes | GET /v1/projects/{projectOrProductUID}/routes | |
| update_route | PUT /v1/projects/{projectOrProductUID}/routes/{routeUID} |
create_route
NotehubRoute create_route(project_or_product_uid, notehub_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
configuration = notehub_py.Configuration(
access_token = "PERSONAL_ACCESS_TOKEN"
)
# 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_or_product_uid = 'app:2606f411-dea6-44a0-9743-1130f57d77d8' # str |
notehub_route = {"http":{"disable_http_headers":false,"filter":{},"fleets":["fleet:1042ddc5-3b2c-4cec-b1fb-d3040538094d"],"http_headers":{"X-My-Header":"value"},"throttle_ms":100,"timeout":5000,"transform":{},"url":"https://example.com/ingest"},"label":"Route Label"} # NotehubRoute | Route to be created
try:
api_response = api_instance.create_route(project_or_product_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_or_product_uid | str | ||
| notehub_route | NotehubRoute | Route to be created |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
delete_route
delete_route(project_or_product_uid, route_uid)
Delete single route within a project
Example
import notehub_py
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(
access_token = "PERSONAL_ACCESS_TOKEN"
)
# 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_or_product_uid = 'app:2606f411-dea6-44a0-9743-1130f57d77d8' # str |
route_uid = 'route:cbd20093cba58392c9f9bbdd0cdeb1a0' # str |
try:
api_instance.delete_route(project_or_product_uid, route_uid)
except Exception as e:
print("Exception when calling RouteApi->delete_route: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| route_uid | str |
Return type
void (empty response body)
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_route
NotehubRoute get_route(project_or_product_uid, route_uid)
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
configuration = notehub_py.Configuration(
access_token = "PERSONAL_ACCESS_TOKEN"
)
# 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_or_product_uid = 'app:2606f411-dea6-44a0-9743-1130f57d77d8' # str |
route_uid = 'route:cbd20093cba58392c9f9bbdd0cdeb1a0' # str |
try:
api_response = api_instance.get_route(project_or_product_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_or_product_uid | str | ||
| route_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_route_logs_by_route
List[RouteLog] get_route_logs_by_route(project_or_product_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, most_recent_only=most_recent_only, files=files, routing_status=routing_status, response_status=response_status)
Get Route Logs by Route UID
Example
import notehub_py
from notehub_py.models.route_log import RouteLog
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(
access_token = "PERSONAL_ACCESS_TOKEN"
)
# 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_or_product_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 = 'date' # str | (optional) (default to 'date')
sort_order = 'desc' # str | (optional) (default to 'desc')
start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional)
system_files_only = True # bool | (optional)
most_recent_only = True # bool | (optional)
files = '_health.qo, data.qo' # str | (optional)
routing_status = ['failure'] # List[str] | (optional)
response_status = ['500'] # List[str] | (optional)
try:
api_response = api_instance.get_route_logs_by_route(project_or_product_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, most_recent_only=most_recent_only, files=files, routing_status=routing_status, response_status=response_status)
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_or_product_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 'date'] | |
| sort_order | str | [optional] [default to 'desc'] | |
| start_date | int | Start date for filtering results, specified as a Unix timestamp | [optional] |
| end_date | int | End date for filtering results, specified as a Unix timestamp | [optional] |
| system_files_only | bool | [optional] | |
| most_recent_only | bool | [optional] | |
| files | str | [optional] | |
| routing_status | List[str] | [optional] | |
| response_status | List[str] | [optional] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_routes
List[NotehubRouteSummary] get_routes(project_or_product_uid)
Get all Routes within a Project
Example
import notehub_py
from notehub_py.models.notehub_route_summary import NotehubRouteSummary
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(
access_token = "PERSONAL_ACCESS_TOKEN"
)
# 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_or_product_uid = 'app:2606f411-dea6-44a0-9743-1130f57d77d8' # str |
try:
api_response = api_instance.get_routes(project_or_product_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_or_product_uid | str |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
update_route
NotehubRoute update_route(project_or_product_uid, route_uid, notehub_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
configuration = notehub_py.Configuration(
access_token = "PERSONAL_ACCESS_TOKEN"
)
# 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_or_product_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_or_product_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_or_product_uid | str | ||
| route_uid | str | ||
| notehub_route | NotehubRoute | Route settings to be updated |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
Usage API
All URIs are relative to https://api.notefile.net
| Method | HTTP request | Description |
|---|---|---|
| get_data_usage | GET /v1/projects/{projectOrProductUID}/usage/data | |
| get_events_usage | GET /v1/projects/{projectOrProductUID}/usage/events | |
| get_route_logs_usage | GET /v1/projects/{projectOrProductUID}/usage/route-logs | |
| get_sessions_usage | GET /v1/projects/{projectOrProductUID}/usage/sessions |
get_data_usage
GetDataUsage200Response get_data_usage(project_or_product_uid, period, start_date=start_date, end_date=end_date, device_uid=device_uid, fleet_uid=fleet_uid, limit=limit, aggregate=aggregate)
Get data usage in bytes for a project with time range and period aggregation
Example
import notehub_py
from notehub_py.models.get_data_usage200_response import GetDataUsage200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.UsageApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
period = "period_example" # str | Period type for aggregation
start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional)
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
fleet_uid = ["fleet_uid_example"] # List[str] | Filter by Fleet UID (optional)
limit = 200000 # int | Limit the number of data points returned (optional) (default to 200000)
aggregate = (
"device" # str | Aggregation level for results (optional) (default to 'device')
)
try:
api_response = api_instance.get_data_usage(
project_or_product_uid,
period,
start_date=start_date,
end_date=end_date,
device_uid=device_uid,
fleet_uid=fleet_uid,
limit=limit,
aggregate=aggregate,
)
print("The response of UsageApi->get_data_usage:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UsageApi->get_data_usage: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| period | str | Period type for aggregation | |
| start_date | int | Start date for filtering results, specified as a Unix timestamp | [optional] |
| end_date | int | End date for filtering results, specified as a Unix timestamp | [optional] |
| device_uid | List[str] | A Device UID. | [optional] |
| fleet_uid | List[str] | Filter by Fleet UID | [optional] |
| limit | int | Limit the number of data points returned | [optional] [default to 200000] |
| aggregate | str | Aggregation level for results | [optional] [default to 'device'] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_events_usage
UsageEventsResponse get_events_usage(project_or_product_uid, period, start_date=start_date, end_date=end_date, device_uid=device_uid, fleet_uid=fleet_uid, limit=limit, aggregate=aggregate, notefile=notefile, skip_recent_data=skip_recent_data, include_notefiles=include_notefiles)
Get events usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied
Example
import notehub_py
from notehub_py.models.usage_events_response import UsageEventsResponse
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.UsageApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
period = "period_example" # str | Period type for aggregation
start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional)
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
fleet_uid = ["fleet_uid_example"] # List[str] | Filter by Fleet UID (optional)
limit = 200000 # int | Limit the number of data points returned (optional) (default to 200000)
aggregate = (
"device" # str | Aggregation level for results (optional) (default to 'device')
)
notefile = [
"notefile_example"
] # List[str] | Filter to specific notefiles (optional)
skip_recent_data = False # bool | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. (optional) (default to False)
include_notefiles = False # bool | Include per-notefile event counts in the response (optional) (default to False)
try:
api_response = api_instance.get_events_usage(
project_or_product_uid,
period,
start_date=start_date,
end_date=end_date,
device_uid=device_uid,
fleet_uid=fleet_uid,
limit=limit,
aggregate=aggregate,
notefile=notefile,
skip_recent_data=skip_recent_data,
include_notefiles=include_notefiles,
)
print("The response of UsageApi->get_events_usage:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UsageApi->get_events_usage: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| period | str | Period type for aggregation | |
| start_date | int | Start date for filtering results, specified as a Unix timestamp | [optional] |
| end_date | int | End date for filtering results, specified as a Unix timestamp | [optional] |
| device_uid | List[str] | A Device UID. | [optional] |
| fleet_uid | List[str] | Filter by Fleet UID | [optional] |
| limit | int | Limit the number of data points returned | [optional] [default to 200000] |
| aggregate | str | Aggregation level for results | [optional] [default to 'device'] |
| notefile | List[str] | Filter to specific notefiles | [optional] |
| skip_recent_data | bool | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | [optional] [default to False] |
| include_notefiles | bool | Include per-notefile event counts in the response | [optional] [default to False] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_route_logs_usage
GetRouteLogsUsage200Response get_route_logs_usage(project_or_product_uid, period, start_date=start_date, end_date=end_date, route_uid=route_uid, limit=limit, aggregate=aggregate, skip_recent_data=skip_recent_data)
Get route logs usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied
Example
import notehub_py
from notehub_py.models.get_route_logs_usage200_response import (
GetRouteLogsUsage200Response,
)
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.UsageApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
period = "period_example" # str | Period type for aggregation
start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional)
route_uid = ["route_uid_example"] # List[str] | A Route UID. (optional)
limit = 200000 # int | Limit the number of data points returned (optional) (default to 200000)
aggregate = (
"route" # str | Aggregation level for results (optional) (default to 'route')
)
skip_recent_data = False # bool | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. (optional) (default to False)
try:
api_response = api_instance.get_route_logs_usage(
project_or_product_uid,
period,
start_date=start_date,
end_date=end_date,
route_uid=route_uid,
limit=limit,
aggregate=aggregate,
skip_recent_data=skip_recent_data,
)
print("The response of UsageApi->get_route_logs_usage:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UsageApi->get_route_logs_usage: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| period | str | Period type for aggregation | |
| start_date | int | Start date for filtering results, specified as a Unix timestamp | [optional] |
| end_date | int | End date for filtering results, specified as a Unix timestamp | [optional] |
| route_uid | List[str] | A Route UID. | [optional] |
| limit | int | Limit the number of data points returned | [optional] [default to 200000] |
| aggregate | str | Aggregation level for results | [optional] [default to 'route'] |
| skip_recent_data | bool | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | [optional] [default to False] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
get_sessions_usage
GetSessionsUsage200Response get_sessions_usage(project_or_product_uid, period, start_date=start_date, end_date=end_date, device_uid=device_uid, fleet_uid=fleet_uid, limit=limit, aggregate=aggregate, skip_recent_data=skip_recent_data)
Get sessions usage for a project with time range and period aggregation, when endDate is 0 or unspecified the current time is implied
Example
import notehub_py
from notehub_py.models.get_sessions_usage200_response import GetSessionsUsage200Response
from notehub_py.rest import ApiException
from pprint import pprint
configuration = notehub_py.Configuration(access_token="PERSONAL_ACCESS_TOKEN")
# 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.UsageApi(api_client)
project_or_product_uid = "app:2606f411-dea6-44a0-9743-1130f57d77d8" # str |
period = "period_example" # str | Period type for aggregation
start_date = 1628631763 # int | Start date for filtering results, specified as a Unix timestamp (optional)
end_date = 1657894210 # int | End date for filtering results, specified as a Unix timestamp (optional)
device_uid = ["device_uid_example"] # List[str] | A Device UID. (optional)
fleet_uid = ["fleet_uid_example"] # List[str] | Filter by Fleet UID (optional)
limit = 200000 # int | Limit the number of data points returned (optional) (default to 200000)
aggregate = (
"device" # str | Aggregation level for results (optional) (default to 'device')
)
skip_recent_data = False # bool | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. (optional) (default to False)
try:
api_response = api_instance.get_sessions_usage(
project_or_product_uid,
period,
start_date=start_date,
end_date=end_date,
device_uid=device_uid,
fleet_uid=fleet_uid,
limit=limit,
aggregate=aggregate,
skip_recent_data=skip_recent_data,
)
print("The response of UsageApi->get_sessions_usage:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling UsageApi->get_sessions_usage: %s\n" % e)Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| project_or_product_uid | str | ||
| period | str | Period type for aggregation | |
| start_date | int | Start date for filtering results, specified as a Unix timestamp | [optional] |
| end_date | int | End date for filtering results, specified as a Unix timestamp | [optional] |
| device_uid | List[str] | A Device UID. | [optional] |
| fleet_uid | List[str] | Filter by Fleet UID | [optional] |
| limit | int | Limit the number of data points returned | [optional] [default to 200000] |
| aggregate | str | Aggregation level for results | [optional] [default to 'device'] |
| skip_recent_data | bool | When true, skips fetching recent data from raw event tables and only returns data from summary tables. Use this for better performance on large projects. | [optional] [default to False] |
Return type
HTTP request headers
- Content-Type: Not defined
- Accept: application/json