Skip to main content

Python Client for interacting with the Zyxel Nebula API

Project description

Zyxel Nebula API Client

This is an unofficial Python client for interacting with the Zyxel Nebula API, providing access to manage sites, devices, and clients within the Zyxel Nebula environment.

Features

  • Retrieve clients connected to a specific site.
  • View device firmware status and client connectivity.
  • Manage sites and device groups within the Zyxel Nebula ecosystem.

Requirements

  • Python 3.12 or higher
  • An API key for Zyxel Nebula

Installation

Install the package using pip:

pip install zyxel-nebula-client

Usage

Retrieve API key

Login in to Nebula and generate an API token which located at Site-wide > Configure > Site settings is specifically used to generate an API token for DPPSK third-party integration.

Setup the Client

To begin, initialize the client with your API key:

from zyxel_nebula_client import ZyxelNebulaClient

# Replace 'your_api_key_here' with your actual API key
client = ZyxelNebulaClient(api_key='your_api_key_here')

Example Usage

1. Retrieve Site Clients

To retrieve a list of clients connected to a specific site:

from zyxel_nebula_client import ClientAttributesReq

site_id = "your_site_id"

# Specify the attributes you want to retrieve for each client
attributes = [ClientAttributesReq.mac_address, ClientAttributesReq.ipv4_address]

# Asynchronous call to get site clients
clients = await client.get_site_clients(site_id=site_id, attributes=attributes)

# Print client information
for client in clients:
    print(client)

2. Retrieve Organizations

To retrieve a list of organizations associated with your API key, you can use the following code snippet:

# Asynchronous call to get organizations
organizations = await client.get_organizations()

# Print organization information
for org in organizations:
    print(f"Organization ID: {org.org_id}, Name: {org.name}")

3. Retrieve Sites for a Specific Organization

To get a list of sites within a specific organization, use this example:

org_id = "your_org_id"

# Asynchronous call to get sites for the specified organization
sites = await client.get_sites(org_id=org_id)

# Print site information
for site in sites:
    print(f"Site ID: {site.site_id}, Name: {site.name}, Location: {site.location}")

4. Get Device Firmware Status

To retrieve the firmware status of devices within a specific organization, use this example:

org_id = "your_org_id"

# Asynchronous call to get firmware status
firmware_status = await client.get_device_firmware_status_from_organization(org_id=org_id)

# Print firmware status for each device
for status in firmware_status:
    print(f"Device ID: {status.device_id}, Firmware Version: {status.firmware_version}, Status: {status.status}")

Documentation

For more details, refer to the Zyxel Nebula API documentation.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please read the CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.

Issues

If you encounter any issues or have feature requests, please open an issue in the GitHub repository.

Acknowledgements

  • Zyxel Nebula API for providing the API documentation.
  • All contributors who help improve this project.

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

zyxel_nebula_client-0.1.2.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

zyxel_nebula_client-0.1.2-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file zyxel_nebula_client-0.1.2.tar.gz.

File metadata

  • Download URL: zyxel_nebula_client-0.1.2.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.8.0-45-generic

File hashes

Hashes for zyxel_nebula_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f511476d09952e74b8c53d5e8187bd9daba3e3a457b5ce73a97038f9cdcaf0ab
MD5 dd912590e87a36f5a883b6ebf6ce98c1
BLAKE2b-256 e8bbd924a1ba280452a7b7910dba94c9e02350346dde324bf1cd9f65ff25bd23

See more details on using hashes here.

File details

Details for the file zyxel_nebula_client-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for zyxel_nebula_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bf2a0115ea1ff1020f16c9a2c540e4d19fcc1008d699a749c551d09489786238
MD5 8c4bf0ce2a95299fa6286a280ca336b9
BLAKE2b-256 a9c4cca153090e2eee79f1838490678b06f1bf7043d936b16c55d2ba2a631b49

See more details on using hashes here.

Supported by

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