GET
Use the HTTP GET method with the queue
resource to
request information about queues.
The information that is returned is similar to the information returned by the Inquire Queue and Inquire Queue Status PCF commands, and the DISPLAY QUEUE and DISPLAY QSTATUS MQSC commands.
queue
resource with the HTTP GET method in
either of the following situations:- The type optional query parameter is not specified.
- The type optional query parameter is specified as either
all
orcluster
.
Resource URL
https://host:port/ibmmq/rest/v1/admin/qmgr/{qmgrName}
/queue/{queueName}
- qmgrName
- Specifies the name of the queue manager on which to query the queues.
- queueName
- Optionally specifies the name of a queue that exists on the queue manager specified.
You can use HTTP instead of HTTPS if you enable HTTP connections. For more information about enabling HTTP, see Configuring HTTP and HTTPS ports.
Optional query parameters
- attributes={object,...|*|object.attributeName,...}
-
- object,...
- Specifies a comma-separated list of JSON objects that contain related queue configuration attributes to return.
- *
- Specifies all attributes.
- object.attributeName,...
- Specifies a comma-separated list of queue configuration attributes to return.
- status={status|*|status.attributeName,...}
-
- status
- Specifies that all status attributes are returned.
- *
- Specifies all attributes. This parameter is equivalent to status.
- status.attributeName,...
- Specifies a comma-separated list of status attributes to return.
- applicationHandle={applicationHandle|*|applicationHandle.attributeName,...}
-
- applicationHandle
- Specifies that all application handle attributes are returned.
- *
- Specifies all attributes. This parameter is equivalent to applicationHandle.
- applicationHandle.attributeName,...
- Specifies a comma-separated list of application handle attributes to return.
- commandScope=scope
- This parameter is only available on z/OS.
- filter=filterValue
- Specifies a filter for the queue definitions that are returned.
- name=name
- This query parameter cannot be used if you specify a queue name in the resource URL.
- queueSharingGroupDisposition=disposition
- This parameter is only available on z/OS.
- type=type
- Specifies the type of queue to return information about.
Request headers
- Authorization
- This header must be sent if you are using basic authentication. For more information, see Using HTTP basic authentication with the REST API.
- ibm-mq-rest-gateway-qmgr
- This header specifies the queue manager that is to be used as the gateway queue manager. The gateway queue manager is used to connect to a remote queue manager. For more information, see Remote administration using the REST API.
Request body format
None.
Security requirements
The caller must be authenticated to the mqweb server and must be a member of
one or more of the MQWebAdmin
, MQWebAdminRO
, or
MQWebUser
roles. For more information about security for the administrative REST API, see IBM MQ Console and REST API security.
If token based security is used, the LTPA token that is used to authenticate the user must be provided with the request as a cookie. For more information about token-based authentication, see Using token-based authentication with the REST API.
- If the status or applicationHandle query parameters
are not specified:
- For the queue that is specified by the {queueName} portion of the resource URL, or for queues that match the specified query parameters, authority to issue the MQCMD_INQUIRE_Q PCF command must be granted.
- If the status or applicationHandle query parameters
are specified:
- For the queue that is specified by the {queueName} portion of the resource URL, or for queues that match the specified query parameters, authority to issue the MQCMD_INQUIRE_Q PCF command must be granted.
- For the queue that is specified by the {queueName} portion of the resource URL, or for queues that match the specified query parameters, authority to issue the MQCMD_INQUIRE_QSTATUS PCF command must be granted.
On UNIX, Linux®, and Windows, you can grant authority to security principals to use IBM MQ resources by using the setmqaut command. For more information, see setmqaut (grant or revoke authority).
On z/OS, see Setting up security on z/OS.
Response status codes
- 200
- Queue information retrieved successfully.
- 400
- Invalid data provided.
- 401
- Not authenticated.
- 403
- Not authorized.
- 404
- Queue does not exist.
- 500
- Server issue or error code from IBM MQ.
- 503
- Queue manager not running.
Response headers
- Content-Type
- This header is returned with a value of
application/json;charset=utf-8
. - ibm-mq-qmgrs
- On z/OS, if the optional query parameter
commandScope=* is used, this header is returned with a comma-separated list of the queue managers
that generated a response. For example, the header might look like the following header:
ibm-mq-qmgrs: MQ21, MQ22
- ibm-mq-rest-gateway-qmgr
- This header is returned if a remote queue manager is specified in the resource URL. The value of this header is the name of the queue manager that is used as the gateway queue manager.
Response body format
The response is in JSON format in
UTF-8 encoding. The response contains an outer JSON object that contains a single JSON array called
queue
. Each element in the array is a JSON object that represents information about
a queue. Each of these JSON objects contains the following attributes:
- name
- String.
- type
- String.
The following objects can be included in the JSON object that represents information about a queue. Which objects and attributes are returned depends on the URL that was specified for the request:
- remote
- Contains attributes that are related to remote queues.
- alias
- Contains attributes that are related to alias queues.
- dynamic
- Contains attributes that are related to dynamic queues.
- model
- Contains attributes that are related to model queues.
- cluster
- Contains attributes that are related to clusters.
- trigger
- Contains attributes that are related to triggering.
- events
- Contains two objects, one for queue depth and one for queue service interval events. Each object contains attributes that are related to the event type.
- applicationDefaults
- Contains attributes that are related to default behavior such as message persistence, message priority, shared input settings, and read ahead settings.
- queueSharingGroup
- Contains attributes that are related to queue sharing groups on z/OS.
- dataCollection
- Contains attributes that are related to data collection, monitoring, and statistics.
- storage
- Contains attributes that are related to message storage, such as the maximum depth of the queue, and the maximum length of messages that are allowed on the queue.
- general
- Contains attributes that are related to general queue properties, such as whether get or put operations are inhibited, the description of the queue, and transmission queue settings.
- extended
- Contains attributes that are related to extended queue properties, such as backout queue settings, and shared input settings.
- timestamps
- Contains attributes that are related to date and time information, such as the time stamp of when a queue was created.
- status
- Contains attributes that are related to queue status information.
- applicationHandle
- Contains attributes that are related to application handle information.
If a damaged object is found, and
the REST request did not specify a queue, an extra JSON array that is called
damaged
is returned. This JSON array contains a list of the objects that are
damaged, specifying the object names. If the REST request specifies a queue name within the resource
URL, but the object is damaged, an error is returned.
If an error occurs, the response body contains an error message. For more information, see REST API error handling.
Examples
SYSTEM.*
queues is returned. It is expected that all
queues are returned. However, for brevity, the results shown in the following examples do not
include all the expected results.- The following example lists all queues on the queue manager
QM1
. The following URL is used with the HTTP GET method:https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue
{ "queue": [{ "name": "localQueue", "type": "local" } , { "name": "remoteQueue", "type": "remote", "remote": { "queueName": "queueOnQM1", "qmgrName": "QM1" } } , { "name": "aliasQueue", "type": "alias", "alias": { "targetName": "localQueue" } }, { "name": "modelQueue", "type": "model", "model": { "type": "permanentDynamic" } }, { "name": "permanentDynamicQueue", "type": "local", "dynamic": { "type": "permanentDynamic" } },{ "name": "aliasQueue2", "type": "cluster", "cluster": { "name": "CLUSTER1", "qmgrName" : "QM2", "queueType": "alias" } }] }
- The following example lists all local queues on the queue manager
QM1
, showing whether they are get or put enabled. The following URL is used with the HTTP GET method:https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QMGR2/queue?type=local&attributes=general.inhibitPut,general.inhibitGet
{ "queue": [{ "name": "localQueue", "type": "local", "general": { "inhibitPut": true, "inhibitGet": false, } }, { "name": "permanentDynamicQueue", "type": "local", "dynamic": { "type": "permanentDynamic" }, "general": { "inhibitPut": false, "inhibitGet": false, } }] }
- The following example lists the status attributes for the queue
Q1
, on queue managerQM1
. The following URL is used with the HTTP GET method:https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue/Q1?status=*
{ "queue": [{ "name": "Q1", "status": { "currentDepth": 0, "lastGet": "2016-12-05T15:56:28.000Z", "lastPut": "2016-12-05T15:56:28.000Z", "mediaRecoveryLogExtent": "", "oldestMessageAge": 42, "onQueueTime": { "longSamplePeriod": 3275, "shortSamplePeriod": 3275 }, "openInputCount": 1, "openOutputCount": 1, "uncommittedMessages": 2 }, "type": "local" }] }
- The following example lists the application handle attributes for a queue
Q1
, on queue managerQM1
. The following URL is used with the HTTP GET method:https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue/Q1?applicationHandle=*
{ "queue": [{ "applicationHandle": [{ "asynchronousState": "none", "channelName": "", "connectionName": "", "description": "", “state": "inactive", "openOptions": [ "MQOO_INPUT_SHARED", "MQOO_BROWSE", "MQOO_INQUIRE", "MQOO_SAVE_ALL_CONTEXT", "MQOO_FAIL_IF_QUIESCING" ], "processID": 9388, "qmgrTransactionID": "AAAAAAhAAAA=", "recoveryID": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "tag": "IBM\\Java70\\jre\\bin\\javaw.exe", "threadID": 0, "transactionType": "qmgr", "type": "userApplication", "userID": "myID" }, { "asynchronousState": "none", "channelName": "", "connectionName": "", "description": "", “state": "inactive", "openOptions": [ "MQOO_OUTPUT", "MQOO_FAIL_IF_QUIESCING" ], "processID": 9388, "qmgrTransactionID": "AAAAAAhAAAA=", "recoveryID": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "tag": "IBM\\Java70\\jre\\bin\\javaw.exe", "threadID": 0, "transactionType": "qmgr", "type": "userApplication", "userID": "myID" }], "name": "Q1", "type": "local" }] }
-
The following example shows how to get all information, including status and application handles, for the queue
Q2
on queue managerQM1
. The following URL is used with the HTTP GET method:https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue/Q2?attributes=*&status=*&applicationHandle=*
-
The following example shows how to get all queue configuration and status information for queues with an openInputCount greater than three, for the queue manager
QM1
. The following URL is used with the HTTP GET method:https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue?attributes=*&status=*&filter=status.openInputCount:greaterThan:3