Business Critical Services Operational Insights API SDK
Project description
Business Critical Services Operational Insights API SDK
SDK for the Business Critical Services (BCS) Operations Insights (OI) API
Example
from bcs_oi_api import BCSOIAPI
from bcs_oi_api.models import Device, SecurityAdvisory, SecurityAdvisoryBulletin, SecurityAdvisoryOutcome
bcs_oi_api = BCSOIAPI(
client_id='client id',
client_secret='client secret',
region='us'
)
# Getting a generator for all discovered devices
devices = bcs_oi_api.get_output(model=Device)
# Building a dictionary with as key the device_id and the value the Device object for lookups
devices_dict = {device.device_id: device for device in devices}
# Getting a generator for all the Security Advisories
security_advisories = bcs_oi_api.get_output(model=SecurityAdvisory)
# Getting a generator for all the Security Advisory Bulletins
security_advisory_bulletins = bcs_oi_api.get_output(model=SecurityAdvisoryBulletin)
# Building a dictionary with as key the id of the bulletin and as value the bulletin itself for lookups
security_advisory_bulletins_dict = {bulletin.security_advisory_cold_id: bulletin for bulletin in
security_advisory_bulletins}
# Listing devices which are vulnerable
for advisory in security_advisories:
if advisory.match_confidence == SecurityAdvisoryOutcome.VULNERABLE:
print(
f"Device \"{devices_dict[advisory.device_id].device_name}\" is vulnerable to "
f"\"{security_advisory_bulletins_dict[advisory.security_advisory_cold_id].bulletin_title}\""
)
Installation
Installing and upgrading is easy:
Install via PIP
$ pip install bcs-oi-api
Upgrading to the latest Version
$ pip install bcs-oi-api --upgrade
Questions, Support & Discussion
bcs-oi-api is a community developed and community supported project. Feedback, thoughts, questions, issues can be submitted using the issues page.
Contribution
bcs-oi-api is a community developed project. Code contributions are welcome via PRs!
Copyright (c) 2018-2021 Cisco and/or its affiliates.
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
bcs-oi-api-1.0.1.tar.gz
(12.0 kB
view hashes)
Built Distribution
bcs_oi_api-1.0.1-py3-none-any.whl
(16.7 kB
view hashes)
Close
Hashes for bcs_oi_api-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0df2d56b3d90ad132c354a2fdd190376f6f48ae185072d94ac0c92f44bb1d70f |
|
MD5 | 65789699460180ddbb11ec5f36e3d03b |
|
BLAKE2b-256 | 3f74e363f167dd49b3b4dfa9a8d40172506edbadf4127a70dc6a81a8f2ae4b45 |