IoT Inspector API client
Project description
IoT Inspector API Client
This is the official Python client for the IoT Inspector public API.
Usage
First, you have to log in and select a tenant:
from iot_inspector_client import Client
YOUR_API_URL = "https://demo.iot-inspector.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@iot-inspector.com.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
iot_inspector_client-0.1.1.tar.gz
(19.0 kB
view hashes)
Built Distribution
Close
Hashes for iot_inspector_client-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47b235173c391c330e7d3f55eeccf5a1a597ef99d5f113619ddc10c9a4d6a8d9 |
|
MD5 | 0bfd792a11c2f60db28f8397c913fa17 |
|
BLAKE2b-256 | d62149ed8108a17a3725f911b8dce1c010ade0c68c3995b8a4dd9c196a5e5fa7 |
Close
Hashes for iot_inspector_client-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1228025bb9dc0d85b892acd396c66257097669f0e2413f826fc0f6fff027694 |
|
MD5 | 77341d9e911f6c29e35eefcf3e5964e2 |
|
BLAKE2b-256 | d40fba01e054676f3d6fe434d63f2570990a32d175b9bd90a2486a0a135eaed4 |