Skip to content

Commit c11ac4d

Browse files
committed
doc updates and fix to list columns
1 parent 828c9ff commit c11ac4d

File tree

3 files changed

+101
-70
lines changed

3 files changed

+101
-70
lines changed

elmclient/examples/OSLCQUERY.md

Lines changed: 70 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -65,103 +65,128 @@ Two commands are installed with `elmclient`: `oslcquery` and `batchquery`, put i
6565
Usage
6666
=====
6767

68-
NOTE if you can't get a query to work check the 'When things go wrong' chapter below
68+
NOTE if you can't get a query to work check the 'When things go wrong' section below
6969

7070
To get all the usage options use `-h` or `--help`:
7171

7272
```
73-
usage: oslcquery [-h] [-f SEARCHTERMS] [-n NULL] [-o ORDERBY] [-p PROJECTNAME] [-q QUERY] [-r RESOURCETYPE] [-s SELECT] [-u] [-v VALUE] [-A APPSTRINGS] [-C COMPONENT]
74-
[-D DELAYBETWEENPAGES] [-E GLOBALPROJECT] [-F CONFIGURATION] [-G GLOBALCONFIGURATION] [-H SAVECONFIGS] [-J JAZZURL] [-L LOGLEVEL] [-M MAXRESULTS] [-N]
75-
[-O OUTPUTFILE] [-P PASSWORD] [-S] [-T] [-U USERNAME] [-V] [-W] [-X XMLOUTPUTFILE] [-Y] [-Z PROXYPORT] [--nresults NRESULTS]
76-
[--compareresults COMPARERESULTS] [--pagesize PAGESIZE] [--typesystemreport TYPESYSTEMREPORT] [--cachedays CACHEDAYS] [-0 SAVECREDS] [-1 READCREDS]
77-
[-2 ERASECREDS] [-3 SECRET] [-4]
73+
usage: oslcquery [-h] [-f SEARCHTERMS] [-n NULL] [-o ORDERBY] [-p PROJECTNAME] [-q QUERY] [-r RESOURCETYPE]
74+
[-s SELECT] [-u] [-v VALUE] [-A APPSTRINGS] [-C COMPONENT] [-D DELAYBETWEENPAGES] [-E GLOBALPROJECT]
75+
[-F CONFIGURATION] [-G GLOBALCONFIGURATION] [-H SAVECONFIGS] [-I] [-J JAZZURL] [-L LOGLEVEL]
76+
[-M MAXRESULTS] [-N] [-O OUTPUTFILE] [-P PASSWORD] [-Q] [-R] [-S] [-T] [-U USERNAME] [-V] [-W]
77+
[-X XMLOUTPUTFILE] [-Y] [-Z PROXYPORT] [--nresults NRESULTS] [--compareresults COMPARERESULTS]
78+
[--pagesize PAGESIZE] [--typesystemreport TYPESYSTEMREPORT] [--cachedays CACHEDAYS] [-0 SAVECREDS]
79+
[-1 READCREDS] [-2 ERASECREDS] [-3 SECRET] [-4]
7880
79-
Perform OSLC query on a Jazz application, with results output to CSV (and other) formats - use -h to get some basic help
81+
Perform OSLC query on a Jazz application, with results output to CSV (and other) formats - use -h to get some basic
82+
help
8083
81-
optional arguments:
84+
options:
8285
-h, --help show this help message and exit
8386
-f SEARCHTERMS, --searchterms SEARCHTERMS
8487
**APPS MAY NOT FULLY SUPPORT THIS** A word or phrase to search, returning ranked results"
85-
-n NULL, --null NULL Post-filter: A property that must be null (empty) for the resource to be included in the results - you can specify this option more than once
88+
-n NULL, --null NULL Post-filter: A property that must be null (empty) for the resource to be included in the
89+
results - you can specify this option more than once
8690
-o ORDERBY, --orderby ORDERBY
87-
**APPS MAY NOT FULLY SUPPORT THIS** A comma-separated list of properties to sort by - prefix with "+" for ascending, "-" for descending- if
88-
-f/--searchterms is specified this orders items with the same oslc:score - to speciy a leading -, use = e.g. -o=-dcterms:title
91+
**APPS MAY NOT FULLY SUPPORT THIS** A comma-separated list of properties to sort by - prefix
92+
with "+" for ascending, "-" for descending- if -f/--searchterms is specified this orders items
93+
with the same oslc:score - to speciy a leading -, use = e.g. -o=-dcterms:title
8994
-p PROJECTNAME, --projectname PROJECTNAME
9095
Name of the project - omit to run a query on the application
9196
-q QUERY, --query QUERY
9297
Enhanced OSLC query (defaults to empty string which returns all resources)
9398
-r RESOURCETYPE, --resourcetype RESOURCETYPE
94-
The app-specific type being searched, e.g. Requirement for RM, Configuration for GC - this can be the full URI from the query capability resource
95-
type,, a prefixed uri, or the unqiue last part of the query URL - also used for resolving ambiguous attribute names in -q/-s/-v/-n
99+
The app-specific type being searched, e.g. Requirement for RM, Configuration for GC - this can
100+
be the full URI from the query capability resource type,, a prefixed uri, or the unqiue last
101+
part of the query URL - also used for resolving ambiguous attribute names in -q/-s/-v/-n
96102
-s SELECT, --select SELECT
97-
A comma-separate list of properties that should be included in the results - NOTE the app may include additional properties, and may not include
98-
the requested properties
99-
-u, --unique Post-filter: Remove results with an rm_nav:parent value which are not-unique in the results on dcterms:identifier - this keeps module artifacts
100-
(which don't have rm_nav:parent) and artifacts for modules (which don't have a module artifact)) - RELEVANT ONLY FOR DOORS Next!
103+
A comma-separate list of properties that should be included in the results - NOTE the app may
104+
include additional properties, and may not include the requested properties
105+
-u, --unique Post-filter: Remove results with an rm_nav:parent value which are not-unique in the results on
106+
dcterms:identifier - this keeps module artifacts (which don't have rm_nav:parent) and
107+
artifacts for modules (which don't have a module artifact)) - RELEVANT ONLY FOR DOORS Next!
101108
-v VALUE, --value VALUE
102-
Post-filter: A property name that must have a value for the resource to be included in the results - you can specify this option more than once
109+
Post-filter: A property name that must have a value for the resource to be included in the
110+
results - you can specify this option more than once
103111
-A APPSTRINGS, --appstrings APPSTRINGS
104-
A comma-seperated list of apps, the query goes to the first entry, default "rm". Each entry must be a domain or domain:contextroot e.g. rm
105-
or rm:rm1 - Default can be overridden using environemnt variable QUERY_APPSTRINGS
112+
A comma-seperated list of apps, the query goes to the first entry, default "rm,gc,ccm". Each
113+
entry must be a domain or domain:contextroot e.g. rm or rm:rm1 - Default can be set using
114+
environemnt variable QUERY_APPSTRINGS
106115
-C COMPONENT, --component COMPONENT
107116
The local component (optional, you *have* to specify the local configuration using -F)
108117
-D DELAYBETWEENPAGES, --delaybetweenpages DELAYBETWEENPAGES
109-
Delay in seconds between each page of results - use this to reduce overall server load particularly for large result sets or when retrieving many
110-
properties
118+
Delay in seconds between each page of results - use this to reduce overall server load
119+
particularly for large result sets or when retrieving many properties
111120
-E GLOBALPROJECT, --globalproject GLOBALPROJECT
112121
The global configuration project - needed if the globalconfiguration isn't unique
113122
-F CONFIGURATION, --configuration CONFIGURATION
114123
The local configuration
115124
-G GLOBALCONFIGURATION, --globalconfiguration GLOBALCONFIGURATION
116-
The global configuration (you must not specify local config as well!) - you can specify the id, the full URI, or the config name (not implemented
117-
yet)
125+
The global configuration (you must not specify local config as well!) - you can specify the
126+
id, the full URI, or the config name (not implemented yet)
118127
-H SAVECONFIGS, --saveconfigs SAVECONFIGS
119128
Name of CSV file to save details of the local project components and configurations
129+
-I, --totalize For all columns with multiple results, put in the total instead of the results
120130
-J JAZZURL, --jazzurl JAZZURL
121-
jazz server url (without the /jts!) default https://jazz.ibm.com:9443 - Default can be set using environemnt variable QUERY_JAZZURL - defaults to
122-
https://jazz.ibm.com:9443 which DOESN'T EXIST
131+
jazz server url (without the /jts!) default https://jazz.ibm.com:9443 - Default can be set
132+
using environemnt variable QUERY_JAZZURL - defaults to https://jazz.ibm.com:9443 which DOESN'T
133+
EXIST
123134
-L LOGLEVEL, --loglevel LOGLEVEL
124-
Set logging on console and (if providing a , and a second level) to file to one of DEBUG, INFO, WARNING, ERROR, CRITICAL, OFF - default is None -
125-
can be set by environment variable QUERY_LOGLEVEL
135+
Set logging to file and (by adding a "," and a second level) to console to one of DEBUG,
136+
TRACE, INFO, WARNING, ERROR, CRITICAL, OFF - default is None - can be set by environment
137+
variable QUERY_LOGLEVEL
126138
-M MAXRESULTS, --maxresults MAXRESULTS
127-
Max number of results to retrieve a pagesize at a time, then the query is terminated. default is no limit
139+
Max number of results to retrieve a pagesize at a time, then the query is terminated. default
140+
is no limit
128141
-N, --noprogressbar Don't show progress bar during query
129142
-O OUTPUTFILE, --outputfile OUTPUTFILE
130143
Name of file to save the CSV to
131144
-P PASSWORD, --password PASSWORD
132-
user password, default ibm - Default can be set using environment variable QUERY_PASSWORD - set to PROMPT to be asked for password at runtime
133-
-S, --sort Don't sort results by increasing dcterms:identifier, as is done by default - specifying -o (orderby) disables automatic sorting by
134-
dcterms:identifier
145+
user password, default ibm - Default can be set using environment variable QUERY_PASSWORD -
146+
set to PROMPT to be asked for password at runtime
147+
-Q, --resolvenames toggle name resolving off (default on) - can greatly speed up postprocessing but you'll get
148+
URIs rather than names
149+
-R, --nodefaultselects
150+
Suppress adding default select like for rm rm_nav:folder and dcterms:identifier - can speed up
151+
postprocessing because e.g. no need to look up folder name
152+
-S, --sort Don't sort results by increasing dcterms:identifier, as is done by default - specifying -o
153+
(orderby) disables automatic sorting by dcterms:identifier
135154
-T, --certs Verify SSL certificates
136155
-U USERNAME, --username USERNAME
137156
user id, default ibm - Default can be set using environment variable QUERY_USER
138157
-V, --verbose Show verbose info
139-
-W, --cachecontrol Used once -W erases cache then continues with caching enabled. Used twice -WW wipes cache and disables caching. Otherwise caching is continued
140-
from previous run(s).
158+
-W, --cachecontrol Used once -W erases cache then continues with caching enabled. Used twice -WW wipes cache and
159+
disables caching. Otherwise caching is continued from previous run(s).
141160
-X XMLOUTPUTFILE, --xmloutputfile XMLOUTPUTFILE
142-
For each query result, GET the artifact and save to file with this base name plus the identifier (if present) - PROBABLY RELEVANT ONLY TO RM!
161+
For each query result, GET the artifact and save to file with this base name plus the
162+
identifier (if present) - PROBABLY RELEVANT ONLY TO RM!
143163
-Y, --debugprint Print the raw results
144164
-Z PROXYPORT, --proxyport PROXYPORT
145165
Port for proxy default is 8888 - used if found to be active - set to 0 to disable
146-
--nresults NRESULTS Number of results expected - used for regression testing - use `--nresults -1` to disable checking
166+
--nresults NRESULTS Number of results expected - used for regression testing - use `--nresults -1` to disable
167+
checking
147168
--compareresults COMPARERESULTS
148169
TESTING UNFINISHED: saved CSV file to compare results with
149170
--pagesize PAGESIZE Page size for OSLC query (default 200)
150171
--typesystemreport TYPESYSTEMREPORT
151-
Load the specified project/configuration and then produce a simple HTML type system report of resource shapes/properties/enumerations to this
152-
file
172+
Load the specified project/configuration and then produce a simple HTML type system report of
173+
resource shapes/properties/enumerations to this file
153174
--cachedays CACHEDAYS
154-
The number of days for caching received data, default 1. To disable caching use -WW. To keep using a non-default cache period you must specify
155-
this value every time
175+
The number of days for caching received data, default 1. To disable caching use -WW. To keep
176+
using a non-default cache period you must specify this value every time
156177
-0 SAVECREDS, --savecreds SAVECREDS
157-
Save obfuscated credentials file for use with readcreds, then exit - this stores jazzurl, jts, appstring, username and password
178+
Save obfuscated credentials file for use with readcreds, then exit - this stores jazzurl, jts,
179+
appstring, username and password
158180
-1 READCREDS, --readcreds READCREDS
159-
Read obfuscated credentials from file - completely overrides commandline/environment values for jazzurl, jts, appstring, username and password
181+
Read obfuscated credentials from file - completely overrides commandline/environment values
182+
for jazzurl, jts, appstring, username and password
160183
-2 ERASECREDS, --erasecreds ERASECREDS
161184
Wipe and delete obfuscated credentials file
162185
-3 SECRET, --secret SECRET
163-
SECRET used to encrypt and decrypt the obfuscated credentials (make this longer for greater security) - required if using -0 or -1
164-
-4, --credspassword Prompt user for a password to save/read obfuscated credentials (make this longer for greater security)
186+
SECRET used to encrypt and decrypt the obfuscated credentials (make this longer for greater
187+
security) - required if using -0 or -1
188+
-4, --credspassword Prompt user for a password to save/read obfuscated credentials (make this longer for greater
189+
security)
165190
```
166191

167192

@@ -430,6 +455,7 @@ To find all artifacts in project/component in a specific module id 3892 modified
430455

431456
To find all artifacts in project/component in a specific module id 3892 modified before a specific date `-q rm:module=~3892 and dcterms:modified<"2020-08-01T21:51:40.979Z"^^xsd:dateTime` - NOTE this is using the enhanced OSLC Query sytnax for finding an artifact by id using ~
432457

458+
To totalize a column which has multiple results replacing them with a count of the number of results, which might be useful for example to get a count of artifacts in each module, use a query for modules `rdm_types:ArtifactFormat=jazz_rm:Module` and select `oslc_rm:uses` then use the -I option. Because this doesn't need name resolution which can slow the query and post-processing down when processing many modules, also use -R and -Q - for results from components across a GC `/gc/configuration/26` in GCM project `gcproj` the query looks like: `-s oslc_rm:uses,dcterms:title -q rdm_types:ArtifactFormat=jazz_rm:Module -G 26 -E gcproj` - the result is a spreadsheet containing the module URI, the module name and identifier and a column with the count of artifacts in the module.
433459

434460
GCM basic usage
435461
===============

elmclient/examples/oslcquery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def do_oslc_query(inputargs=None):
398398
# ensure some important attributes are always in the output
399399
# ensure that identifier and parent are always in the results
400400
if themaindomain == 'rm':
401-
if args.nodefaultselects:
401+
if not args.nodefaultselects:
402402
args.select = ensure_select(args.select,[app.identifier_uri,'rm_nav:parent'])
403403
elif themaindomain == 'ccm':
404404
args.select = ensure_select(args.select,[app.identifier_uri])

0 commit comments

Comments
 (0)