Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Python client for ELM with examples of OSLC Query, ReqIF import/export, Reportable REST, and more
Python client for IBM Enterprise Lifecycle Management applications
(c) Copyright 2021- IBM Inc. All rights reserved
SPDX-License-Identifier: MIT
version="0.28.0"
16-Dec-2024
02-Dec-2024
oslc:rm:uses{dcterms:identifier}
wasn't working - note that DN doesn't appear to support retreiving primary text of all artifacts in a module using oslc:rm:uses{jazz_rm:primaryText}
- text isn't returned11-Dec-2023
16-Aug-2023
4-May-2023
The aim of this code is to provide a Python client for the IBM Enterprise Lifecycle Management (ELM) applications, providing a demonstrator of using the APIs.
IMPORTANT NOTES:
Included in this package are a few examples using elmclient
which are reasonably functional:
There are links to these examples below.
Either method of install described below installs the elmclient package and puts example commands (such as oslcquery
into your path so a) they can be run simply by typing the command, e.g. oslcquery
and b) as you edit the source code these commands automatically use the latest code.
Requirements: Python 3.11/3.10/3.9 - NOTE I'm developing using Python 3.11.4 and compatibility with older versions is NOT checked. However I'm aiming to work back to 3.9 because that's embedded in e.g. RHEL 9.4.
Step 1: Install Python so it can be run from a command prompt Either Step 2a: Quickest and easiest to get started: install elmclient from pypi Or Step 2b: If you want to change elmclient code
Install Python so you can run Python from the commandline - might be python3 if you're on *nix. On Windows the command is python
- you can find install guides all over the internet.
This method is also easiest to update with new versions of elmclient.
At a command prompt:
pip install elmclient
pip3 install elmclient
To update:
pip install -U elmclient
pip3 install -U elmclient
Using this method you could copy the examples from where they're lurking in your Python installation's library to a different folder, rename if using one of the commands such as oslcquery to a different name, and edit them in this folder separate from the elmclient install.
Test that all was successful by running oslcquery -h
you should get a version number then a swathe of text with all the options.
This method assumes you have developer knowledge how to modify and merge code.
By far the preferred method is to first fork the github repository. You'll then get a folder on your PC which has a sub-folder `elmclient'.
Open a command prompt in the folder which has a subfolder elmclient
and run the command (Windows) pip install -e .
or (*nix) pip3 install -e .
Test that all was successful by running oslcquery -h
you should get a version number then a swathe of text with all the options.
You code will import elmclient, then use it.
The basis of using the elmclient is to first create a "server", then add the needed application(s) to it - typically just one application such as rm, or perhaps more applications such as rm and gc.
Then you can use the API functions to find projects, components, configurations, etc.
The DN reportable REST example provides a simple functional example with hard-coded values for the project, configuration and the artifact ID to be queried. This is the easy way to get into using elmclient - by modifying this example.
The other examples add fairly complex details around the use of elmclient to provide a commandline interface and should provide again a starting point for further development.
The auth code works with:
Other authentication methods haven't been tested.
You'll have to provide a username and password; that username will determine the permissions to read/write data on your server, just as they would through a browser UI.
The examples oslcquery
and reqif_io
layer authentication enhancements on top of this to allow saving obfuscated credentials to a file so you don't have to provide these on the commandline every time. See the code for these examples.
As of 16-Dec you can now use application passwords. These authenticate to a single app, but it's easy to imagine needed to talk to e.g. GC (on/gc) and RM (on /rm), so the support is implemented by encoding one or more application passwords in the "password".
The password you use when using application passwords has a prefix ap: and then a comma-seperated list of one or more application passwords (specifying the contextroot:password) and then finally a non-application password. So for example if you want to use an application password AP1 with context root rm, your password would look like ap:rm:AP1. If you also want to talk to GC on /gc and to anything else using your non-ap password then use ap:rm:AP1,gc:AP2,mypassword
This hasn't been extensively tested. Please let me know in the Issues if this works for you or has problems.
It's possible to install the ELM applications to run on non-standard context roots like /rm1 for DOORS Next, or /scm for EWM. This is handled in elmclient
using APPSTRINGs. These specify the domain of an application using rm, jts, gc, ccm, qm, and the context root as a string without the leading /. So for example /rm1 would be specified as rm:rm1
, or /scm would be specified as ccm:scm
.
For example, if your DN is on /rm then just specify rm
. Or, if it's on /rm23 then specify rm:rm23
.
If more than one application is needed then use a comma separate list (without spaces). The main application is specified first, and if jts is also needed on /jts1 then your APPSTRING could be rm:rm1,jts:jts1
.
These examples drove the evolution of elmclient
:
elmclient
to access the DOORS Next Reportable REST API - hardcodedThis code provides examples of using various ELM APIs:
DN
elmclient
oslcquery.py
for user use, internally oslcqueryapi.py
implements OSLC Query parsing and queryingdn_simple_modulestructure.py
- currently external to elmclient
reqif_io.py
- currently reqif API is external to elmclient
represt.py
for user use, internally for each application in _rm.py
, _ccm.py
, _qm.py
ETM
elmclient
oslcquery.py
for user use, internally oslcqueryapi.py
implements OSLC Query parsing and queryingreprest.py
for user use, internally for each application in _rm.py
, _ccm.py
, _qm.py
EWM
elmclient
oslcquery.py
for user use, internally oslcqueryapi.py
implements OSLC Query parsing and queryingreprest.py
for user use, internally for each application in _rm.py
, _ccm.py
, _qm.py
GCM
elmclient
oslcquery.py
for user use, internally oslcqueryapi.py
implements OSLC Query parsing and queryingIf you find a problem with elmclient you can report it on the github issues https://github.com/IBM/ELM-Python-Client/issues - note this is just for issues with elmclient code. All other issues will likely be closed immediately.
You can do a pull request to propose updates - there's no guarantee of if/when/how these will be merged but we certainly hope to benefit from contributions!
FAQs
Python client for ELM with examples of OSLC Query, ReqIF import/export, Reportable REST, and more
We found that elmclient demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.