Skip to main content

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 to security advisories with a critical impact rating
for advisory in security_advisories:
    if advisory.match_confidence == SecurityAdvisoryOutcome.VULNERABLE and \
            security_advisory_bulletins_dict[advisory.security_advisory_cold_id].security_impact_rating == 'Critical':
        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.3.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

bcs_oi_api-1.0.3-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file bcs-oi-api-1.0.3.tar.gz.

File metadata

  • Download URL: bcs-oi-api-1.0.3.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2

File hashes

Hashes for bcs-oi-api-1.0.3.tar.gz
Algorithm Hash digest
SHA256 89483bf522e49f1cc260525e503ff8be5d0aeb874f7576c3ba9cc8424c88e6fe
MD5 a7e4bc93413ab8a0ed50bc4bdb507bdc
BLAKE2b-256 4d4d6e9e177eb3153323279f2c3f4c84ecef02ce369514f4f5874dda07a73ad5

See more details on using hashes here.

File details

Details for the file bcs_oi_api-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: bcs_oi_api-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.2

File hashes

Hashes for bcs_oi_api-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e5550ae09d406dd49fa71c04525161db4ab47934dd59065000be07736de83f32
MD5 150ac2e6b73662c16224e1fe76009729
BLAKE2b-256 1b869d028b8545ee74ac8316a8977bde59635a308003879652b7e75feeb8ddc3

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