'ucsql' is a Python-based scripting tool that accesses the UCS Data Management Engine (DME) using SQL, translated over the XML/API.
Currently ‘ucsql’ is targeted for customers of UCS Central, who wish to have scriptable access for reporting purposes.
Among the features and benefits of ‘ucsql’:
‘ucsql’ has the ability to show/describe the UCS managed object schema, providing a list of all available classes, as well as the attributes for a given class, as in “show table”.
‘ucsql’ provides “sessions”, similar to ‘goUCS’, so that customers can run secure scripted commands, without interactive credential prompting
‘ucsql’ exploits the common API and managed objects between UCS Manager, UCS Central and UCS C-Series XML/API. Therefore, the same version of ‘ucsql’ can be used against all 3 engines (UCS Central, UCS Manager, UCS C-Series CIMC)
Some examples and use cases include:
Collecting Blade Inventory: “select dn, serial, numOfCores, totalMemory from computeBlade”
Reporting the location and creation time of all backup files:
“select ts, tftpURL from configBackup”
Describe/show the attributes in the “orgDomainGroup” class: “show orgDomainGroup”
Show all the Domain Group info: “select * from orgDomainGroup”
Show all registered domains: “select name, id, ip from extpolClient”
Show firmware versions running on each system component: “select * from firmwareRunning”
List all VHBA's and their WWPNs, possibly for SAN pre-provisioning : "select dn, addr from vnicFc"
Extract certain fields for Fault reporting :
"select severity, descr, cause, created, type, dn from faultInst"What makes ‘ucsql’ so useful?
Currently, there are no programmatic SDK’s available for UCS Central. Users wishing to write scripts for UCS Central must currently do so directly through the XML/API using ‘http’ or ‘curl’.
Does ‘ucsql’ support the entire SQL language?
That would be nice. The current version supports single table ‘select’ and ‘show’ statements. Future feature support could easily include configuration commands (‘insert’, ‘update’, ‘delete’). Longer term feature support could include 2-table joins and support for UCS ‘inhierarchical’.