Client
ucmdb_rest.client.UCMDBServer(user, password, server, port=8443, protocol='https', ssl_validation=False, client_context=1, classic=True)
The primary interface for interacting with the UCMDB REST API.
This class manages the lifecycle of a UCMDB session, including authentication, token refreshment, and provides access to specialized sub-modules for topology, discovery, and policies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server
|
str
|
The hostname or IP address of the UCMDB server. |
required |
user
|
str
|
The username for authentication. |
required |
password
|
str
|
The password for authentication. |
required |
port
|
int
|
The REST API port (default is 8443). |
8443
|
protocol
|
str
|
The connection protocol, 'http' or 'https' (default is 'https'). |
'https'
|
ssl_validation
|
bool
|
Whether to verify the server's SSL certificate (default is False). |
False
|
client_context
|
int
|
The UCMDB client context ID (default is 1). |
1
|
classic
|
bool
|
Whether UCMDB is installed in classic or containerized. Classic is a standalone installation on Windows or Linux where containerized is installed in a Linux Kubernetes or other Kubernetes cluster. If installing in an AWS EC2 instance (for example) it would be 'classic'. If installing in Google's GKE, it would be 'containerized'. True = classic, False = containerized. (default is True). |
True
|
Attributes:
| Name | Type | Description |
|---|---|---|
session |
Session
|
The underlying HTTP session used for all requests. |
data_flow |
DataFlowManagement
|
Access to probe management, ranges, and credentials. |
data_model |
DataModel
|
Access to the UCMDB class model and attributes. |
topology |
Topology
|
Access to CI and Relationship querying and creation. |
discovery |
Discovery
|
Access to discovery jobs and inventory tools. |
mgmt_zones |
ManagementZones
|
Access to management zone configurations. |
policies |
Policies
|
Access to policy and compliance features. |
integrations |
Integrations
|
Access to integration points and data push/pull jobs. |
reports |
Reports
|
Access to UCMDB reports and query results. |
system |
System
|
Access to server status, licensing, and general settings. |
settings |
Settings
|
Access to infrastructure settings. |
packages |
Packages
|
Access to Content Pack management. |
expose |
ExposeCI
|
Access to CI export/expose features. |
ldap |
RetrieveLDAP
|
Access to LDAP configuration. |
Source code in ucmdb_rest\client.py
from_json(config_path)
classmethod
Initialize a UCMDBServer instance from a configuration file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config_path
|
str
|
The path to the JSON file containing credentials and server details. |
required |
Returns:
| Type | Description |
|---|---|
UCMDBServer
|
An authenticated instance of the UCMDBServer client. |