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

Uploaded Source

Built Distribution

zyxel_nebula_client-0.1.3-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zyxel_nebula_client-0.1.3.tar.gz
  • Upload date:
  • Size: 11.2 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.3.tar.gz
Algorithm Hash digest
SHA256 dd833f4bdff88cff09a313316a3833b9ef7cdc51b23f25de9dfe355728078825
MD5 5015a59f0dfd7ef6dfe7370e7e83a9f5
BLAKE2b-256 c69aedd3f47f6e5b77a1a1493e30513431ce90e4ffba7cbaf06fb987b2785868

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for zyxel_nebula_client-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0d92fde7f3806fbc925dacb3d0af2a82ac26bd57c5298f3c790db741eb6c54a3
MD5 c43bc805084dc30562d76fde4e66e5fb
BLAKE2b-256 50b19b7c9df00caa6b0d7865a04e75b32cc70604b17323bafea29da0308209f8

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