Python bindings for accessing OSIDB API
Project description
osidb-bindings
A client library for accessing OSIDB API
Installation
pip install -e git+https://git.prodsec.redhat.com/devops/osidb-bindings.git#egg=osidb_bindings
Usage
import osidb_bindings
# Basic auth
osidb_session = osidb_bindings.new_session(osidb_server_uri="http://localhost:8000/", username="username", password="password")
or
# Token auth
osidb_session = osidb_bindings.new_session(osidb_server_uri="http://localhost:8000/", token="token")
# Get status
osidb_session.status()
# Retrieve flaw
flaw = osidb_session.retrieve(id="CVE-1111-2222")
# Attributes can be accessed directly via .
flaw.summary
flaw.impact
# or the flaw can be converted into dict
flaw_dict = flaw.to_dict()
flaw_dict["summary"]
flaw_dict["impact"]
# Retrieving multiple flaws
all_flaws = osidb_session.retrieve_list()
# All query params listed in OpenAPI schema can be passed as well
filtered_flaws = osidb_session.retrieve_list(impact="IMPORTANT", tracker_ids=["111111", "222222"])
# number of results
filtered_flaws.count
# list with the results
filtered_flaws.results
For more details read tutorial
For development details read developer guide
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
osidb-bindings-1.0.3.tar.gz
(29.8 kB
view hashes)
Built Distribution
Close
Hashes for osidb_bindings-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1bd1995fe353381324185fc18fcda12c20d62bc8da8b6fb794b0d8367f2a8e0 |
|
MD5 | fe5f303a164d57964ea740d04ddbf051 |
|
BLAKE2b-256 | d51f5ed5d8301e1a2009a3edef0c9f6d3c75722c0d53a298e50b35c292cac442 |