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 Index » IBM MQ API Support » DISPLAY PROCESS and CHANNEL with REST API

Post new topic  Reply to topic
 DISPLAY PROCESS and CHANNEL with REST API « View previous topic :: View next topic » 
Author Message
pcouas
PostPosted: Wed Jun 26, 2019 8:35 pm    Post subject: DISPLAY PROCESS and CHANNEL with REST API Reply with quote

Voyager

Joined: 06 Sep 2011
Posts: 79

Hi

There is no JSON return for PROCESS and CHANNEL
Regards

curl https://localhost:9443/ibmmq/rest/v1/admin/action/qmgr/QM1/mqsc -X POST -H "Content-Type: application/json" -d "{ \"type\": \"runCommand\", \"parameters\": { \"command\": \"DISPLAY CHANNEL(*) TYPE(CLNTCONN)\" }}" -H "ibm-mq-rest-csrf-token: blank" -k -u admin:passw0rd
--> OK

curl https://localhost:9443/ibmmq/rest/v1/admin/action/qmgr/QM1/mqsc -X POST -H "Content-Type: application/json" -d "{ \"type\": \"runCommand\", \"parameters\": { \"command\": \"DISPLAY PROCESS(PROCESS3)\" }}" -H "ibm-mq-rest-csrf-token: blank" -k -u admin:passw0rd
--> OK
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Jun 27, 2019 8:02 pm    Post subject: Reply with quote

Padawan

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

You appear to be using the correct command. When I issue your command against my own web server (running at IBM MQ V9.1.0) I get the following responses:-

Code:
curl https://localhost:9443/ibmmq/rest/v1/admin/action/qmgr/QM1/mqsc -X POST -H "Content-Type: application/json" -d "{ \"type\": \"runCommand\", \"parameters\": { \"command\": \"DISPLAY CHANNEL(*) TYPE(CLNTCONN)\" }}" -H "ibm-mq-rest-csrf-token: blank" -k -u admin:passw0rd


Code:
{
  "commandResponse": [{
    "completionCode": 0,
    "reasonCode": 0,
    "text": ["AMQ8414I: Display Channel details.   CHANNEL(SYSTEM.DEF.CLNTCONN)            CHLTYPE(CLNTCONN)"]
  }],
  "overallCompletionCode": 0,
  "overallReasonCode": 0
}


and ..

Code:
curl https://localhost:9443/ibmmq/rest/v1/admin/action/qmgr/QM1/mqsc -X POST -H "Content-Type: application/json" -d "{ \"type\": \"runCommand\", \"parameters\": { \"command\": \"DISPLAY PROCESS(PROCESS3)\" }}" -H "ibm-mq-rest-csrf-token: blank" -k -u admin:passw0rd


Code:
{
  "commandResponse": [{
    "completionCode": 2,
    "reasonCode": 2085,
    "text": ["AMQ8147E: IBM MQ object PROCESS3 not found."]
  }],
  "overallCompletionCode": 2,
  "overallReasonCode": 3008
}


I don't have a process object called PROCESS3, but both these examples serve to illustrate that you will always get back an answer in the above form saying something.

How does your environment differ from mine? I am running IBM MQ V9.1 on Windows 10, with curl that comes with Windows 10. What are you using? Do get any response back from ANY of your MQSC commands issued with REST?

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
pcouas
PostPosted: Thu Jun 27, 2019 10:47 pm    Post subject: Reply with quote

Voyager

Joined: 06 Sep 2011
Posts: 79

Hi

I have created PROCESS3 before
curl https://localhost:9443/ibmmq/rest/v1/admin/action/qmgr/QM1/mqsc -X POST -H "Content-Type: application/json" -d "{\"type\": \"runCommand\",\"parameters\": {\"command\": \"define process (PROCESS3) \"}}" -H "ibm-mq-rest-csrf-token: blank" -k -u admin:passw0rd
and
curl https://localhost:9443/ibmmq/rest/v1/admin/action/qmgr/QM1/mqsc -X POST -H "Content-Type: application/json" -d "{\"type\": \"runCommand\",\"parameters\": {\"command\": \"SET AUTHREC PROFILE(PROCESS3) OBJTYPE(PROCESS) GROUP('mqclient') AUTHADD(ALL)\"}}" -H "ibm-mq-rest-csrf-token: blank" -k -u admin:passw0rd






(my test Qmanager is in an Docker 9.1.2, i see this object with last MQMON tool version)


url https://localhost:9443/ibmmq/rest/v1/admin/action/qmgr/QM1/mqsc -X POST -H "Content-Type: application/json" -d "{ \"type\": \"runCommand\", \"parameters\": { \"command\": \"DISPLAY PROCESS(PROCESS3)\" }}" -H "ibm-mq-rest-csrf-token: blank" -k -u admin:passw0rd
I could see answer but it is TEXT
commandResponse": [{
"completionCode": 0,
"reasonCode": 0,
"text": ["AMQ8407I: Display Process details. PROCESS(PROCESS3) APPLTYPE(UNIX) APPLICID( ) ENVRDATA( ) USERDATA( ) DESCR( ) ALTDATE(2019-06-21) ALTTIME(08.08.2"]
}],

It is NOT an JSON Object, no good for MicroService framework
Back to top
View user's profile Send private message
hughson
PostPosted: Thu Jun 27, 2019 11:34 pm    Post subject: Reply with quote

Padawan

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

pcouas wrote:
It is NOT an JSON Object, no good for MicroService framework


That is how the MQSC REST Interface works. If you need a JSON object, you will have to wait until the REST API is updated to include PROCESS objects. IBM has not stated when this will be, if ever.

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
hughson
PostPosted: Tue Jul 30, 2019 8:28 pm    Post subject: Reply with quote

Padawan

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

You will be pleased to learn that in IBM MQ V9.1.3, the REST API for MQSC has been updated to output JSON.

You can read more about this here:

A better REST with MQ V9.1.3

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
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » DISPLAY PROCESS and CHANNEL with REST API
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.