# Zyxel Nebula API Client
This is an unofficial Python client for interacting with the [Zyxel Nebula API](https://zyxelnetworks.github.io/NebulaOpenAPI/doc/openapi.html), 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](https://pip.pypa.io/en/stable/):
```bash
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:
```python
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:
```python
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:
```python
# 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:
```python
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:
```python
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](https://zyxelnetworks.github.io/NebulaOpenAPI/doc/openapi.html).
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Contributing
Contributions are welcome! Please read the [CONTRIBUTING.md](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](https://github.com/cemizm/zyxel-nebula-client/issues).
## Acknowledgements
- [Zyxel Nebula API](https://zyxelnetworks.github.io/NebulaOpenAPI/doc/openapi.html) for providing the API documentation.
- All contributors who help improve this project.
Raw data
{
"_id": null,
"home_page": "https://github.com/cemizm/zyxel-nebula-client",
"name": "zyxel-nebula-client",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": null,
"author": "Cem Basoglu",
"author_email": "cem.basoglu@web.de",
"download_url": "https://files.pythonhosted.org/packages/c6/9a/edd3f47f6e5b77a1a1493e30513431ce90e4ffba7cbaf06fb987b2785868/zyxel_nebula_client-0.1.3.tar.gz",
"platform": null,
"description": "\n# Zyxel Nebula API Client\n\nThis is an unofficial Python client for interacting with the [Zyxel Nebula API](https://zyxelnetworks.github.io/NebulaOpenAPI/doc/openapi.html), providing access to manage sites, devices, and clients within the Zyxel Nebula environment.\n\n## Features\n\n- Retrieve clients connected to a specific site.\n- View device firmware status and client connectivity.\n- Manage sites and device groups within the Zyxel Nebula ecosystem.\n\n## Requirements\n\n- Python 3.12 or higher\n- An API key for Zyxel Nebula\n\n## Installation\n\nInstall the package using [pip](https://pip.pypa.io/en/stable/):\n\n```bash\npip install zyxel-nebula-client\n```\n\n## Usage\n\n### Retrieve API key\n\nLogin 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.\n\n### Setup the Client\n\nTo begin, initialize the client with your API key:\n\n```python\nfrom zyxel_nebula_client import ZyxelNebulaClient\n\n# Replace 'your_api_key_here' with your actual API key\nclient = ZyxelNebulaClient(api_key='your_api_key_here')\n```\n\n### Example Usage\n\n#### 1. Retrieve Site Clients\n\nTo retrieve a list of clients connected to a specific site:\n\n```python\nfrom zyxel_nebula_client import ClientAttributesReq\n\nsite_id = \"your_site_id\"\n\n# Specify the attributes you want to retrieve for each client\nattributes = [ClientAttributesReq.mac_address, ClientAttributesReq.ipv4_address]\n\n# Asynchronous call to get site clients\nclients = await client.get_site_clients(site_id=site_id, attributes=attributes)\n\n# Print client information\nfor client in clients:\n print(client)\n```\n\n#### 2. Retrieve Organizations\nTo retrieve a list of organizations associated with your API key, you can use the following code snippet:\n\n```python\n# Asynchronous call to get organizations\norganizations = await client.get_organizations()\n\n# Print organization information\nfor org in organizations:\n print(f\"Organization ID: {org.org_id}, Name: {org.name}\")\n```\n\n#### 3. Retrieve Sites for a Specific Organization\nTo get a list of sites within a specific organization, use this example:\n\n```python\norg_id = \"your_org_id\"\n\n# Asynchronous call to get sites for the specified organization\nsites = await client.get_sites(org_id=org_id)\n\n# Print site information\nfor site in sites:\n print(f\"Site ID: {site.site_id}, Name: {site.name}, Location: {site.location}\")\n```\n\n#### 4. Get Device Firmware Status\nTo retrieve the firmware status of devices within a specific organization, use this example:\n\n```python\norg_id = \"your_org_id\"\n\n# Asynchronous call to get firmware status\nfirmware_status = await client.get_device_firmware_status_from_organization(org_id=org_id)\n\n# Print firmware status for each device\nfor status in firmware_status:\n print(f\"Device ID: {status.device_id}, Firmware Version: {status.firmware_version}, Status: {status.status}\")\n```\n## Documentation\n\nFor more details, refer to the [Zyxel Nebula API documentation](https://zyxelnetworks.github.io/NebulaOpenAPI/doc/openapi.html).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! Please read the [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests.\n\n## Issues\n\nIf you encounter any issues or have feature requests, please open an issue in the [GitHub repository](https://github.com/cemizm/zyxel-nebula-client/issues).\n\n## Acknowledgements\n\n- [Zyxel Nebula API](https://zyxelnetworks.github.io/NebulaOpenAPI/doc/openapi.html) for providing the API documentation.\n- All contributors who help improve this project.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python Client for interacting with the Zyxel Nebula API",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://github.com/cemizm/zyxel-nebula-client"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "50b19b7c9df00caa6b0d7865a04e75b32cc70604b17323bafea29da0308209f8",
"md5": "c43bc805084dc30562d76fde4e66e5fb",
"sha256": "0d92fde7f3806fbc925dacb3d0af2a82ac26bd57c5298f3c790db741eb6c54a3"
},
"downloads": -1,
"filename": "zyxel_nebula_client-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c43bc805084dc30562d76fde4e66e5fb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 11255,
"upload_time": "2024-11-05T08:49:51",
"upload_time_iso_8601": "2024-11-05T08:49:51.996201Z",
"url": "https://files.pythonhosted.org/packages/50/b1/9b7c9df00caa6b0d7865a04e75b32cc70604b17323bafea29da0308209f8/zyxel_nebula_client-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c69aedd3f47f6e5b77a1a1493e30513431ce90e4ffba7cbaf06fb987b2785868",
"md5": "5015a59f0dfd7ef6dfe7370e7e83a9f5",
"sha256": "dd833f4bdff88cff09a313316a3833b9ef7cdc51b23f25de9dfe355728078825"
},
"downloads": -1,
"filename": "zyxel_nebula_client-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "5015a59f0dfd7ef6dfe7370e7e83a9f5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 11204,
"upload_time": "2024-11-05T08:49:53",
"upload_time_iso_8601": "2024-11-05T08:49:53.727492Z",
"url": "https://files.pythonhosted.org/packages/c6/9a/edd3f47f6e5b77a1a1493e30513431ce90e4ffba7cbaf06fb987b2785868/zyxel_nebula_client-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-05 08:49:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cemizm",
"github_project": "zyxel-nebula-client",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "zyxel-nebula-client"
}