Python client for the Cylera Partner API
Project description
cylera-client
A Python client for the Cylera Partner API
Installation
pip install cylera-client
Or with uv:
uv add cylera-client
Usage
from cylera_client import CyleraClient, Organization, Inventory, Utilization, Network, Risk, Threat
client = CyleraClient(
username="you@example.com",
password="your-password",
base_url="https://partner.us1.cylera.com/",
)
Authentication is handled automatically. Tokens are cached and refreshed before expiry.
Organization
organization = Organization(client)
# Get the organization associated with your API credentials
org = organization.get_organization()
# {"organization_id": 17, "name": "Cylera", "internal_name": "cylera"}
# List organizations available to switch into
available = organization.get_available_organizations()
# Switch into a different organization (token is invalidated after switch)
# Note that switch_organization is handled asynchronously
# So, whenever you switch, it is wise to sleep for a few seconds to give
# the back-end time to process the reset request.
organization.switch_organization(available[0]["id"])
# Reset back to your home organization
# Note that reset_organization is handled asynchronously
# So, whenever you reset, it is wise to sleep for a few seconds to give
# the back-end time to process the reset request.
organization.reset_organization()
Inventory
inventory = Inventory(client)
# Get a single device by MAC address
device = inventory.get_device("7f:14:22:72:00:e5")
# List devices with optional filters
devices = inventory.get_devices(
vendor="Philips",
device_class="Medical",
page=0,
page_size=50,
)
# Get device attributes
attrs = inventory.get_device_attributes("7f:14:22:72:00:e5")
Utilization
utilization = Utilization(client)
procedures = utilization.get_procedures(
device_uuid="ffc20dfe-4c24-11ec-8a38-5eeeaabea551",
completed_after="2024/01/01",
page=0,
page_size=100,
)
Network
network = Network(client)
subnets = network.get_subnets(vlan=477)
Risk
risk = Risk(client)
# Get vulnerabilities
vulns = risk.get_vulnerabilities(severity="CRITICAL", status="OPEN")
# Get mitigations for a specific CVE
mitigations = risk.get_mitigations(vulnerability="CVE-2017-2852")
Threats
threat = Threat(client)
threats = threat.get_threats(severity="HIGH", status="OPEN", page=0, page_size=50)
Debugging
Set DEBUG=1 to print request details to stderr (authorization headers are redacted):
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
cylera_client-1.1.1.tar.gz
(8.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cylera_client-1.1.1.tar.gz.
File metadata
- Download URL: cylera_client-1.1.1.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b3bc961f86846b075f2de404a9041c7eb6108f6bf878260dc2bbaedd3cf1a4e
|
|
| MD5 |
7dba90841442bbabae88c73d464f5609
|
|
| BLAKE2b-256 |
6cfc00898055de1d3524abbfd95167abd94d1bb3d45e000e06891b195a4ca007
|
File details
Details for the file cylera_client-1.1.1-py3-none-any.whl.
File metadata
- Download URL: cylera_client-1.1.1-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b9630af49e048fc07b509d7ac7d7284acf08f647eecb4818f33e6146d4cc7fb
|
|
| MD5 |
b003b56d303c81d05d9439971326d61a
|
|
| BLAKE2b-256 |
0013bfe2b573bd349c4d41b4e2faa04409f485f80cf0af20e7539f20f4a85209
|