This article contains a list of REST API commands that pertain to IBM MQ queues.
For a walk-through of the Navigator REST API using the demo site, see Using the REST API using the Navigator demo system. No installation is required. The article Performing REST API operations using the Swagger UI includes three detailed examples, as well as instructions for issuing plain text or JSON-formatted MQSC Commands through the REST API.
Jump ahead: |
Search Queues
GET /ibmmq/queues
Purpose: Finds a queue (on a specific node and queue manager, if specified).
Curl example
curl -X GET "http://jenkins.nastel.com:8019/rest/v1/ibmmq/queues?nodeName=LEUNAME&qmgrName=QA&queueName=TEST%2A" -H "accept: application/json" -H "Authorization: Basic QWRtaW46YWRtaW4="
Example Response
[
{
"wgsName": "MQM",
"nodeName": "LEUNAME",
"qmgrName": "QA",
"name": "TEST",
"type": "Local"
}
]
Create Queue
POST /ibmmq/queues
Purpose: Creates a new queue with a specified name and type on the specified node and queue manager.
Curl example
curl -X POST "http://jenkins.nastel.com:8019/rest/v1/ibmmq/queues" -H "accept: */*" -H "Authorization: Basic QWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d "{\"wgsName\":\"MQM\",\"nodeName\":\"LEUNAME\",\"qmgrName\":\"QA\",\"name\":\"TestQ\",\"type\":\"Local\",\"uri\":\"string\"}"
JSON example: Request
{
"wgsName": "MQM",
"nodeName": "LEUNAME",
"qmgrName": "QA",
"name": "TestQ",
"type": "Local",
“uri”: “string” ,
}
Example Response
Code: 201 (Object Created)
Response headers:
content-length: 0
date: Wed, 08 Dec 2021 19:28:38 GMT
server: Jetty(9.4.28.v20200408)
Read Queue Data
GET /ibmmq/queues/{nodeName}/{qmgrName}/{type}/{queueName}
Purpose: Lists the properties of a specified queue and type on the specified node and queue manager.
Curl example
curl -X GET "http://jenkins.nastel.com:8019/rest/v1/ibmmq/queues/LEUNAME/QA/Local/NASTEL.EVENT.QUEUE?attributes=%2A" -H "accept: application/json" -H "Authorization: Basic QWRtaW46YWRtaW4="
Example Response
{
"wgsName": "MQM",
"nodeName": "LEUNAME",
"qmgrName": "QA",
"name": "NASTEL.EVENT.QUEUE",
"type": "Local",
"uri": "/rest/v1/ibmmq/queues/LEUNAME/QA/Local/NASTEL.EVENT.QUEUE",
"general": {
"description": "AP-WMQ event queue",
"usage": "Normal",
"scope": "QMgr",
"defBind": "On Open",
"defPersistence": "Not Persistent",
"inhibitPut": "Allowed",
"inhibitGet": "Allowed",
"defPriority": 0,
"custom": "",
"qsgDisp": "QMgr"
},
"extended": {
"maxDepth": 100000,
"maxMsgLength": 4194304,
"shareAbility": "Shareable",
"defInputOpenOption": "Shared",
"msgDelivery": "Priority",
"retentionInterval": 999999999,
"distLists": "Not Supported",
"defType": "Predefined",
"npmClass": "Normal",
"propertyCtrl": "Compatibility",
"defReadAhead": "No",
"defPutResponseType": "Synchronous",
"cfStrucName": ""
},
"cluster": {
"clusterName": "",
"clusterNamelist": "",
"clwlPriority": 0,
"clwlRank": 0,
"clwlUseQ": "As On QMgr",
"clusChlName": ""
},
"trigger": {
"triggerCtrl": "Off",
"triggerType": "First",
"triggerDepth": 1,
"triggerMsgPriority": 0,
"triggerData": "",
"initQName": "",
"processName": ""
},
"event": {
"depthMaxEvent": "Enabled",
"depthHighEvent": "Disabled",
"depthHighLimit": 80,
"depthLowEvent": "Disabled",
"depthLowLimit": 20,
"serviceIntervalEvent": "None",
"serviceInterval": 999999999
},
"storage": {
"backoutReQName": "",
"backoutThreshold": 0,
"hardenBackout": "Hardened",
"indexType": "None",
"storageClass": "",
"pagesetId": 0,
"archive": 0,
"streamQueueName": "",
"streamQueueQOS": "Best Effort"
},
"monitoring": {
"monitoringQ": "As On QMgr",
"accountingQ": "As On QMgr",
"statisticsQ": "As On QMgr"
},
"state": {
"lastUpdated": 1638763362000,
"createDate": "2019-04-02",
"createTime": "09.11.27",
"alterDate": "2019-08-28",
"alterTime": "10.55.12",
"timeSinceReset": 1638763362000,
"lastAction": 0,
"openInputCount": 0,
"openOutputCount": 0,
"curQDepth": 0,
"tpipeName": "",
"curQFileSize": 1,
"curMaxFileSize": 2088960,
"lastActivity": 0
},
"message": {
"highQDepth": 0,
"msgEnqCount": 0,
"msgDeqCount": 0,
"lastGetDate": "",
"lastGetTime": "",
"lastPutDate": "",
"lastPutTime": "",
"mediaRecoveryLogExtent": "",
"oldestMsgAge": -1,
"uncommittedMsgs": 0,
"qTimeShort": -1,
"qTimeLong": -1,
"maxQFileSize": -1
},
"jobs": {
"totalJobCount": 0,
"scheduledJobCount": 0,
"canceledJobCount": 0,
"successJobCount": 0,
"failedJobCount": 0,
"readyJobCount": 0,
"pendingJobCount": 0,
"jobIds": []
},
"customProperties": {}
}
Delete Queue
DELETE /ibmmq/queues/{nodeName}/{qmgrName}/{type}/{queueName}
Purpose: Deletes the queue of the specified name and type on the specified node and queue manager.
Curl example
curl -X DELETE "http://jenkins.nastel.com:8019/rest/v1/ibmmq/queues/LEUNAME/QA/Local/TESTQ1" -H "accept: */*" -H "Authorization: Basic QWRtaW46YWRtaW4="
Example Response
Code: 204 (Object Deleted)
Response headers
date: Wed, 08 Dec 2021 19:32:51 GMT
server: Jetty(9.4.28.v20200408)
Force Update Queue
PATCH /ibmmq/queues/{nodeName}/{qmgrName}/{type}/{queueName}/force-update
Purpose: Retrieves the most recent copy of the queue data.
Curl example
curl -X PATCH "http://jenkins.nastel.com:8019/rest/v1/ibmmq/queues/LEUNAME/QA/Local/ABC/force-update" -H "accept: */*" -H "Authorization: Basic QWRtaW46YWRtaW4="
Example Response
Code: 204 (Object Changed)
Response headers
date: Thu, 09 Dec 2021 22:40:49 GMT
server: Jetty(9.4.28.v20200408)
Read Queue authority records
GET /ibmmq/queues/{nodeName}/{qmgrName}/{type}/{queueName}/auth-recs
Purpose: Lists authority records for the queue.
Curl example
curl -X GET "http://jenkins.nastel.com:8019/rest/v1/ibmmq/queues/LEUNAME/LEUNAME/Local/AB.MQ.Q.01/auth-recs" -H "accept: application/json" -H "Authorization: Basic QWRtaW46YWRtaW4="
Example Response
{
"authRecs": [
{
"objectType": "queue",
"objectName": "AB.MQ.Q.01",
"principalName": "SYSTEM@NT AUTHORITY",
"auths": [
"browse",
"chg",
"clr",
"dlt",
"dsp",
"get",
"inq",
"put",
"passall",
"passid",
"set",
"setall",
"setid"
]
},
{
"objectType": "queue",
"objectName": "AB.MQ.Q.01",
"groupName": "mqm@LEUNAME",
"auths": [
"browse",
"chg",
"clr",
"dlt",
"dsp",
"get",
"inq",
"put",
"passall",
"passid",
"set",
"setall",
"setid"
]
}
],
"overallCompletionCode": 0,
"overallReasonCode": 0
}