ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexIBM MQ API SupportAdmin API: Display all objects that a group has access to

Post new topicReply to topic
Admin API: Display all objects that a group has access to View previous topic :: View next topic
Author Message
tx58g
PostPosted: Wed Feb 15, 2023 3:39 am Post subject: Admin API: Display all objects that a group has access to Reply with quote

Newbie

Joined: 15 Feb 2023
Posts: 4

Hi all,
I'm currently working on a little intranet self-service app through which users can order themselves MQ objects and permissions in a controlled way. I am using the admin REST API which has been working OK so far.

Now I would like to display all objects that a group has access to. For that I could do a DISPLAY AUTHREC command on each and every object (I have the full list already). BUT: if there are 3000 queues that means 3000 individual REST calls... not very effective. I didn't find a way to send batch MQSC commands via POST runCommand / runCommandJSON...

Another way would be to use DISPLAY AUTHREC with some wildcard parameters, but I haven't been able to figure out what I need. For example, if I have a group "g_lima_px", and I do

Code:
dis authrec group(g_lima_px)


or

Code:
dis authrec profile(**) group(g_lima_px)


I get nothing.

Code:
dis authrec profile(**)


doesn't work either, it only returns the (**) matches...

If I do name one object specifically, I get results:

Code:
dis authrec profile(LIMA/TST)


not only the specific ones, but wildcard ones as well, eg:

Code:
Display authority record details.
   PROFILE(LIMA*)                          ENTITY(g_lima_px)
   ENTTYPE(GROUP)                          OBJTYPE(TOPIC)
   AUTHLIST(DSP)


Is there a way to avoid asking for the authrec of each MQ object individually? As a last resort I could build up a cache, for all groups and all objects, and refresh it every now and then, but this is something that I would really like to avoid, if at all possible.

Any suggestions would be appreciated.
Back to top
View user's profile Send private message
tx58g
PostPosted: Wed Feb 15, 2023 3:55 am Post subject: Reply with quote

Newbie

Joined: 15 Feb 2023
Posts: 4

As soon as I posted the above, I had an idea out of the blue and tried (in the terminal)

Code:
dis authrec group('g_lima_px')


And it worked! I'm very confused about when names need to be quoted in MQSC commands (for example:

Code:
dis authrec profile(LIMA.TST)


and

Code:
dis authrec profile('LIMA.TST')


both work), but it doesn't hurt trying both ways...

Rubberducking FTW.

(I'm still interested in alternatives, especially how to batch runCommand requests, as there are some other usecases where it would be useful...)
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Feb 15, 2023 8:43 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9302
Location: US: west coast, almost. Otherwise, enroute.

tx58g wrote:
I'm very confused about when names need to be quoted in MQSC commands

The well-documented rule is: if you want to maintain 'lower-case' or 'MixedCase', then enclose in quotes/apostrophes, otherwise the name will be automatically folded into UPPER-CASE. The also well-documented object naming allowable characters are:
letters A-Z upper case
letters a-z lower case
numbers 0-9
special characters ./_%
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Feb 16, 2023 1:40 am Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1850
Location: Bay of Plenty, New Zealand

bruce2359 wrote:
The well-documented rule is: ...

And in case you are wondering WHERE said documentation is, here's a couple of pages for you.
Cheers,
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
bruce2359
PostPosted: Thu Feb 16, 2023 5:51 am Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9302
Location: US: west coast, almost. Otherwise, enroute.

And in case you are wondering WHERE to find Examples of using SQL-like operands in the WHERE clause in the runmqsc DISPLAY command in IBM MQ.
https://www.ibm.com/support/pages/examples-using-sql-operands-where-clause-runmqsc-display-command-ibm-mq
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
tx58g
PostPosted: Thu Feb 16, 2023 6:04 am Post subject: Reply with quote

Newbie

Joined: 15 Feb 2023
Posts: 4

TBH I can hardly think of anything more evil than a command failing silently, instead of complaining (about missing quotes, for example).

Another example for this is the DEFINE PROCESS command, where the APPLTYPE parameter is a string (according to the docs), but it _must not_ be quoted. (But it at least does complain, instead of failing silently.)

To my simple programmer's mind a string is a string because of the quotation marks, and anything else is a keyword, an identifier, or an atom/literal... Oh well. I'm old enough to remember the compulsory TAB characters in Makefiles, life is too easy now!
Back to top
View user's profile Send private message
tx58g
PostPosted: Thu Feb 16, 2023 6:15 am Post subject: Reply with quote

Newbie

Joined: 15 Feb 2023
Posts: 4

bruce2359 wrote:
And in case you are wondering WHERE to find Examples of using SQL-like operands in the WHERE clause in the runmqsc DISPLAY command in IBM MQ.
https://www.ibm.com/support/pages/examples-using-sql-operands-where-clause-runmqsc-display-command-ibm-mq


It does not seem to work with DISPLAY AUTHREC though... or is it just missing from the docs?
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ API SupportAdmin API: Display all objects that a group has access to
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.