Skip to main content

A modular Python client for the UCMDB REST API

Project description

UCMDB REST Python Library

A modern, object-oriented Python 3.6+ wrapper for the OpenText Universal Configuration Management Database (UCMDB) REST API. This library centralizes UCMDB interactions through a unified client, providing type-safe Enums and automated pagination.

Setup and Authentication

This library contains some examples that assume a credentials.json file is in the same direcory as the code.

  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)

Quick Start

The library uses a central UCMDBServer to manage authentication and session persistence.

from ucmdb_rest import UCMDBServer

# Initialize client (assumes credentials.json exists)
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']}")

Practical Examples

To help you get started quickly, here are some example standalone scripts

  • 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: Run a UCMDB View and get the information
  • 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

see Examplese Documentation for detailed setup and usage.

Functional Modules

The library is organized into specialized modules to mirror the UCMDB API ecosystem:

Module Description
client UCMDBServer class which acts as the entry point.
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.

Documentation

For detailed API references, view our Interactive Documentation.

Documentation Workflow

The docs are powered by mkdocs and mkdocstrings.

  • Source: Python Docstrings (numpy Style)
  • Theme: Material for MkDocs
  • Customization: Located in docs/stylesheets/extra.css

Development and Testing

We use pytest for functional validation. To run the suite:

# Run all tests with coverage
pytest --cov=ucmdb_rest

# Preview documentation locally
mkdocs serve

## Release History

## Release History
* **2.0.1 (Current)**
  * Fixed a bunch of failing tests
  * Beginning to add Examples
* **2.0.0**
  * **Major Architecture Milestone**: Completed the 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.7.0**
  * (Internal version alignment release)
* **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.

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.1.tar.gz (45.3 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.1-py3-none-any.whl (42.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ucmdb_rest-2.0.1.tar.gz
  • Upload date:
  • Size: 45.3 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.1.tar.gz
Algorithm Hash digest
SHA256 d809121d9776252a34c58de4479b69b48fee7a310978bcf1cc563ddbe71ab080
MD5 39ca7b04d346f655aabfe6fcbba9a926
BLAKE2b-256 69fb1b7459699a05c3c8e9ba97e5d1c702e31f66b793d34af6017e6f656ab563

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ucmdb_rest-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 42.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eda509a705cb8ef817729ba22f05a31738804c857cb9ce4397007141fffe9d81
MD5 90df9de29bf74fc9a985246f75a0d140
BLAKE2b-256 4c6cfa6d0076f7e3f94fd2cb9a790e6e02b8f8fe38923ba10020f61db77e1aaf

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