
Get list of queue managers - go
Get a list of the queue manager summaries which exist in this service instance.
(mqcloud *MqcloudV1) ListQueueManagers(listQueueManagersOptions *ListQueueManagersOptions) (result *QueueManagerDetailsCollection, response *core.DetailedResponse, err error)
(mqcloud *MqcloudV1) ListQueueManagersWithContext(ctx context.Context, listQueueManagersOptions *ListQueueManagersOptions) (result *QueueManagerDetailsCollection, response *core.DetailedResponse, err error)
Request
Instantiate the ListQueueManagersOptions struct and set the fields to provide
parameter values for the ListQueueManagers method.
| parameter | WithContext method only |
|---|---|
ctxContext
|
A context.Context instance that you can use to specify a timeout for the operation or to cancel an in-flight request. |
| ListQueueManagersOptions | The ListQueueManagers options |
|---|---|
ServiceInstanceGuidRequired*
string |
The GUID that uniquely identifies the IBM® MQ as a Service instance. Possible values: length = 36, Value must match regular expression
Example: |
offsetint64
|
Pagination offset. Possible values: 0 ≤ value ≤ 99999 Default:
|
limitint64
|
The numbers of resources to return. Possible values: 0 ≤ value ≤ 100 Default: Example: |
Example request
listQueueManagersOptions := &mqcloudv1.ListQueueManagersOptions{
ServiceInstanceGuid: core.StringPtr("a2b4d4bc-dadb-4637-bcec-9b7d1e723af8"),
Limit: core.Int64Ptr(int64(10)),
}
pager, err := mqcloudService.NewQueueManagersPager(listQueueManagersOptions)
if err != nil {
panic(err)
}
var allResults []mqcloudv1.QueueManagerDetails
for pager.HasNext() {
nextPage, err := pager.GetNext()
if err != nil {
panic(err)
}
allResults = append(allResults, nextPage...)
}
b, _ := json.MarshalIndent(allResults, "", " ")
fmt.Println(string(b))
Response
| Response BodyQueueManagerDetailsCollection | A list of queue manager summaries |
|---|---|
offsetAlways included*
int64 |
Pagination offset. |
limitAlways included*
int64 |
Results per page, same for all collections. Possible values: value ≤ 50 |
firstAlways included*
|
Link to first page of results. |
|
|
next |
Link to next page of results. |
|
|
previous |
Link to previous page of results. |
|
|
QueueManagersAlways included*
|
List of queue managers. Possible values: 0 ≤ number of items ≤ 50 |
|
| Status code | |
|---|---|
| 200 | An object containing a list of queue managers |
| 301 | URI has permanently Moved |
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Resource not found |
| 429 | Service Is Overused |
| 500 | Internal Server Error |
Example response
Success example
{
"offset": 25,
"limit": 25,
"first": {
"href": "https://api.private.eu-de.mq2.cloud.ibm.com/v1/a2b4d4bc-dadb-4637-bcec-9b7d1e723af8/queue_managers?limit=25"
},
"next": {
"href": "https://api.private.eu-de.mq2.cloud.ibm.com/v1/a2b4d4bc-dadb-4637-bcec-9b7d1e723af8/queue_managers?offset=50&limit=25"
},
"previous": {
"href": "https://api.private.eu-de.mq2.cloud.ibm.com/v1/a2b4d4bc-dadb-4637-bcec-9b7d1e723af8/queue_managers?offset=25&limit=25"
},
"queue_managers": [
{
"id": "b8e1aeda078009cf3db74e90d5d42328",
"name": "testqm",
"display_name": "Test QM",
"location": "ibmcloud_us_south",
"size": "xsmall",
"status_uri": "/v1/a2b4d4bc-dadb-4637-bcec-9b7d1e723af8/queue_managers/b8e1aeda078009cf3db74e90d5d42328/status",
"version": "9.3.2_2",
"web_console_url": "https://web-testqm-fc4f.qm1.eu-de.mq.appdomain.cloud/ibmmq/console",
"rest_api_endpoint_url": "https://web-testqm-fc4f.qm1.eu-de.mq.appdomain.cloud/ibmmq/rest/v3/messaging/qmgr/testqm/queues/<queue_name>/message",
"administrator_api_endpoint_url": "https://web-testqm-fc4f.qm1.eu-de.mq.appdomain.cloud/ibmmq/rest/v3/admin/qmgr/testqm",
"connection_info_uri": "/v1/a2b4d4bc-dadb-4637-bcec-9b7d1e723af8/queue_managers/b8e1aeda078009cf3db74e90d5d42328/connection_info",
"date_created": "2023-07-19T14:46:05Z",
"upgrade_available": false,
"available_upgrade_versions_uri": "/v1/a2b4d4bc-dadb-4637-bcec-9b7d1e723af8/queue_managers/b8e1aeda078009cf3db74e90d5d42328/available_versions",
"href": "https://api.private.eu-de.mq2.cloud.ibm.com/v1/a2b4d4bc-dadb-4637-bcec-9b7d1e723af8/queue_managers/b8e1aeda078009cf3db74e90d5d42328"
}
]
}