|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
DISPLAY PROCESS and CHANNEL with REST API |
« View previous topic :: View next topic » |
Author |
Message
|
pcouas |
Posted: Wed Jun 26, 2019 8:35 pm Post subject: DISPLAY PROCESS and CHANNEL with REST API |
|
|
Voyager
Joined: 06 Sep 2011 Posts: 79
|
|
Back to top |
|
 |
hughson |
Posted: Thu Jun 27, 2019 8:02 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 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 |
|
 |
pcouas |
Posted: Thu Jun 27, 2019 10:47 pm Post subject: |
|
|
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 |
|
 |
hughson |
Posted: Thu Jun 27, 2019 11:34 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 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 |
|
 |
hughson |
Posted: Tue Jul 30, 2019 8:28 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|