diff --git a/create-qlocal.md b/create-qlocal.md new file mode 100644 index 0000000..7861f23 --- /dev/null +++ b/create-qlocal.md @@ -0,0 +1,17 @@ +## POST /ibmmq/rest/v1/admin/qmgr/{qmgrName}/queue +```bash +# New queue from scratch +curl --insecure --header 'Content-Type: application/json' \ +-X POST --header 'Accept: application/json' \ +-d '{ \ + "name": "RLN.TEST.QUEUE", \ + "type": "QLOCAL" \ + }' \ +'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue' + +# New queue like DEV.QUEUE.1 +curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ + "name": "RLN.TEST.QUEUE", \ + "type": "QLOCAL" \ + }' 'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue?like=DEV.QUEUE.1' +``` \ No newline at end of file diff --git a/display-qlocal.md b/display-qlocal.md new file mode 100644 index 0000000..24aa5ea --- /dev/null +++ b/display-qlocal.md @@ -0,0 +1,48 @@ +### GET /ibmmq/rest/v1/admin/qmgr/{qmgrName}/queue +```bash +# Get all queues +curl -X GET \ +--insecure --header 'Accept: application/json' \ +-u admin:passw0rd \ +'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue' + +# Get all DEV* queues +curl -X GET \ +--insecure --header 'Accept: application/json' \ +-u admin:passw0rd \ +'https://localhost:9443/ibmmq/rest/v1/admin/qmgr/QM1/queue?name=DEV*' +``` + +## Expected output +### Search for all queues, or queues that does exist. +Status: 200 OK +```json +{ + "queue": [ + { + "name": "DEV.DEAD.LETTER.QUEUE", + "type": "local" + }, + { + "name": "DEV.QUEUE.3", + "type": "local" + }, + { + "name": "DEV.QUEUE.1", + "type": "local" + }, + { + "name": "DEV.QUEUE.2", + "type": "local" + } + ] +} +``` + +### Search for queue that doesn't exist +Status: 200 OK +```json +{ + "queue": [] +} +``` \ No newline at end of file diff --git a/mqsc.md b/mqsc.md new file mode 100644 index 0000000..48152f8 --- /dev/null +++ b/mqsc.md @@ -0,0 +1,15 @@ +## Using the API +```bash +curl --insecure \ +-k https://localhost:9443/ibmmq/rest/v2/admin/action/qmgr/QM1/mqsc \ +-X POST -u admin:passw0rd -H "ibm-mq-rest-csrf-token: value" \ +-H "Content-Type: application/json" \ +--data @- << EOF +{ + "type": "runCommandJSON", + "command": "define", + "qualifier": "qlocal", + "name": "MSGQ" +} +EOF +``` \ No newline at end of file diff --git a/readme.md b/readme.md index 438bbb0..3e6dd95 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,5 @@ ## Creating a MQ container -https://www.ibm.com/docs/en/ibm-mq/9.3?topic=containers-mq-advanced-developers-container-image +IBM documentation: https://www.ibm.com/docs/en/ibm-mq/9.3?topic=containers-mq-advanced-developers-container-image ```bash # Cleanup previous container @@ -38,25 +38,5 @@ exit docker restart QM1 ``` ## Webconsole / Swagger UI -https://localhost:9443/ibmmq/console/#/ - -https://localhost:9443/ibm/api/explorer - -## Using the API -```bash -curl --insecure -k https://localhost:9443/ibmmq/rest/v2/admin/action/qmgr/QM1/mqsc -X POST -u admin:passw0rd -H "ibm-mq-rest-csrf-token: value" -H "Content-Type: application/json" --data "{\"type\": \"runCommandJSON\",\"command\": \"define\", \"qualifier\": \"qlocal\",\"name\": \"MSGQ\"}" -``` - -### Expected output: -```bash -rasmus@pop-os:~$ curl --insecure -k https://localhost:9443/ibmmq/rest/v2/admin/action/qmgr/QM1/mqsc -X POST -u admin:passw0rd -H "ibm-mq-rest-csrf-token: value" -H "Content-Type: application/json" --data "{\"type\": \"runCommandJSON\",\"command\": \"define\", \"qualifier\": \"qlocal\",\"name\": \"MSGQ\"}" - -{ - "commandResponse": [{ - "completionCode": 0, - "reasonCode": 0, - "message": ["AMQ8006I: IBM MQ queue created."] - }], - "overallReasonCode": 0, - "overallCompletionCode": 0 - ``` \ No newline at end of file +* https://localhost:9443/ibmmq/console/#/ +* https://localhost:9443/ibm/api/explorer \ No newline at end of file