Skip to main content

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-1.2.1.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iot_inspector_client-1.2.1-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file iot_inspector_client-1.2.1.tar.gz.

File metadata

  • Download URL: iot_inspector_client-1.2.1.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.13.0-1021-azure

File hashes

Hashes for iot_inspector_client-1.2.1.tar.gz
Algorithm Hash digest
SHA256 b74b5f778dd4038091d6f8251d46a236d700aa5180858b1b3d240ff48197729f
MD5 dedcc98d383e2e5e06cc55f51c2cc045
BLAKE2b-256 3d9bc0b1b4d4f67ec9907368bba16c4dd1336fff9c31913d5338da9b4f659a78

See more details on using hashes here.

File details

Details for the file iot_inspector_client-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: iot_inspector_client-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.13.0-1021-azure

File hashes

Hashes for iot_inspector_client-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa8106efe14f031acfb6d6feb332ae3487379d2f5d7638204195bd7e4f6d975a
MD5 3191778190b00a4fa6073d11706587a1
BLAKE2b-256 eb9667f4e09899b852a25bbfea2298f87a9e6e57da785a22d1c7c951d61d6950

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page