ONEKEY API Client
This is the official Python client for the ONEKEY public API.
Usage
First, you have to log in and select a tenant:
from onekey_client import Client
YOUR_API_URL = "https://demo.onekey.com/api"
client = Client(api_url=YOUR_API_URL)
client.login(EMAIL, PASSWORD)
tenant = client.get_tenant("Environment name")
client.use_tenant(tenant)
After you logged in and selected the tenant, you can query the GraphQL API
GET_ALL_FIRMWARES = """
query {
allFirmwares {
id
name
}
}
"""
res = client.query(GET_ALL_FIRMWARES)
print(res)
GET_PRODUCT_GROUPS = """
query {
allProductGroups {
id
name
}
}
"""
res = client.query(GET_PRODUCT_GROUPS)
default_product_group = next(pg for pg in res["allProductGroups"] if pg["name"] == "Default")
You can upload firmwares:
metadata = FirmwareMetadata(
name="myFirmware",
vendor_name="myVendor",
product_name="myProduct",
product_group_id=default_product_group["id"],
)
firmware_path = Path("/path/to/firmware.bin")
res = client.upload_firmware(metadata, firmware_path, enable_monitoring=True)
print(res)
Support
You can create a new issue in this repo or contact us at support@onekey.com.
Metadata
Release files for onekey-client 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| onekey_client-2.0.3.tar.gz | 18.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| onekey_client-2.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.4 kB
Release files / onekey_client-2.0.3.tar.gz
| Download URL | onekey_client-2.0.3.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4be7d0548676616cf30e7daf1fbe0fc00c046a40e544e473840bbcd0eea36cac
|
|
BLAKE2b-256 checksum How to use checksums |
10c2b0bb94eaa8201c3aabcafe45dbbc9a15fc69172bf2d605b30c5c4fe89bc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.1 CPython/3.11.0 Linux/5.15.0-1024-azure
|
Release files / onekey_client-2.0.3-py3-none-any.whl
| Download URL | onekey_client-2.0.3-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4fa02c1704a11c098af809501d288bc9bc240797307f7beeb5effea236e96061
|
|
BLAKE2b-256 checksum How to use checksums |
c886e9acf5bbf32137fa61de92eb9c417a893cc8c9dd21d12e04fbb28c7d370d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.1 CPython/3.11.0 Linux/5.15.0-1024-azure
|