Skip to main content

A modular Python client for the UCMDB REST API

Project description

UCMDB REST Python Library

PyPI version Python 3.6+ License: MIT Downloads

A modern, object-oriented Python 3.6+ client for the OpenText Universal Configuration Management Database (UCMDB) REST API. This library eliminates boilerplate by centralizing authentication, session persistence, and pagination through a single unified UCMDBServer entry point — so you can focus on what you want to do, not how to connect.

pip install ucmdb-rest

Why This Library?

Working directly with the UCMDB REST API means managing token authentication, handling session expiry, manually paginating large result sets, and remembering the correct endpoint paths for each operation. ucmdb-rest handles all of that for you through a clean, modular, object-oriented interface with type-safe Enums throughout.

Quick Start

from ucmdb_rest import UCMDBServer

# Initialize client from credentials file
client = UCMDBServer.from_json('credentials.json')

# Quick connectivity check
print(f"Connected to: {client.server_version}")

# Get detailed version info
version = client.system.getUCMDBVersion().json()
print(f"Product: {version['productName']}")
print(f"Content Pack: {version['contentPackVersion']}")

Setup and Authentication

Examples in this library assume a credentials.json file in the same directory as your script.

  1. Copy credentials.json.example to credentials.json
  2. Update the values with your UCMDB server details
Key Description
user UCMDB Username
password UCMDB Password
server FQDN or IP of the UCMDB Server
port REST API port (Default 8443)
ssl_validation Boolean (false to skip certificate checks in lab environments)

Functional Modules

The library mirrors the UCMDB API ecosystem with domain-specific modules:

Module Description
client UCMDBServer class — the unified entry point for all operations.
data_flow_management Operations affecting Data Flow Probes.
datamodel CRUD operations for Configuration Items (CIs) and Relations.
discovery Management of discovery jobs, probe status, and results.
expose_ci On-demand queries of the UCMDB database.
integration Operations affecting integration points.
ldap Operations affecting LDAP integration in UCMDB.
management_zone Operations affecting UCMDB UI zone-based discovery.
packages Deployment and management of UCMDB Content Packs.
policies Policy calculation and automated result chunking.
report Operations involving reports and data exports.
settings Operations involving infrastructure settings and recipients.
system Licensing, versioning, and ping operations.
topology TQL execution, ad-hoc queries, and fetching CI attributes.
utils Shared helper functions and internal constants.

Practical Examples

Ready-to-run scripts are included in the Examples directory:

Script Description
add_cis.py Create CIs and Relationships with custom properties
delete_cis.py Delete CIs by their UCMDB ID
get_recon_rule.py Display a reconciliation rule for a CI Type
initialize_get_version.py Display version information about the UCMDB Server
query_topology.py Run a UCMDB View and retrieve the results
search_and_expose_ci.py Search for a CI by name and get specific properties
show_content_packs.py Display current content pack information
show_license_report.py Display a license report from UCMDB

Documentation

Full API reference is available at kwpaschal.github.io/ucmdb_rest, powered by MkDocs with Material theme and mkdocstrings (numpy-style docstrings).

# Preview documentation locally
mkdocs serve

Development and Testing

# Install dependencies
pip install -r requirements.txt

# Run full test suite with coverage
pytest --cov=ucmdb_rest

Release History

  • 2.0.3 (Current)
    • Improved README with badges, Why This Library section, and documentation links
  • 2.0.2
    • Packaging and metadata updates
  • 2.0.1
    • Fixed failing tests
    • Added example scripts
  • 2.0.0 — Major Architecture Milestone
    • Completed migration of all legacy rest.py components
    • Re-engineered core modules into a modular, object-oriented framework
    • Standardized response handling using requests.Response objects across all modules
    • Enhanced code discoverability via the unified UCMDBServer entry point
  • 1.6.0 — Added Settings and Recipients management
  • 1.5.0 — Added Reports functionality and tests
  • 1.4.0 — Added Management Zone functionality and tests
  • 1.3.0 — Added LDAP configuration retrieval
  • 1.2.0 — Added integration point retrieval
  • 1.1.0 — Added ExposeCI ad-hoc query support
  • 1.0.0 — Initial stable release: Topology and Discovery modules complete

License

MIT License — see LICENSE for details.

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

ucmdb_rest-2.0.3.tar.gz (45.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ucmdb_rest-2.0.3-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

Details for the file ucmdb_rest-2.0.3.tar.gz.

File metadata

  • Download URL: ucmdb_rest-2.0.3.tar.gz
  • Upload date:
  • Size: 45.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ucmdb_rest-2.0.3.tar.gz
Algorithm Hash digest
SHA256 82875237f379561c1181cac492e1936836d09416ebefe859f5b11df7eefbc920
MD5 d2d4fa503a17a1f9c513a29fdcc4aae0
BLAKE2b-256 2e7b6638ba2c1da1779a15035e2e129fa149a99a75b4da3af254349e1a22f3d8

See more details on using hashes here.

File details

Details for the file ucmdb_rest-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: ucmdb_rest-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 42.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ucmdb_rest-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3a94a20d644508a80b2213668337bb107d79e8516172431cabd1741616ec83c4
MD5 f775ad92f7df1f00105852334e50c82e
BLAKE2b-256 9aae8d73c18150ee89b362de5bcd491b1c283e0c06686654b83a0561e15d02be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page