Menu Search

9.3. REST API

9.3.1. REST API Overview

This section provides an overview of REST management API.

If web management is enabled (see Section 9.1.5, “Web Management Configuration”) the REST API can be used to monitor and manage the broker instance.

The Qpid broker REST services support traditional REST model which uses the GET method requests to retrieve the information about broker configured objects, DELETE method requests to delete the configured object, PUT to create the configured object and POST to update the configured objects.

The table below lists the available REST services with brief description how they can be used.

Table 9.1. Rest services

Rest service URLDescriptionGETPUTPOSTDELETE

/rest/broker

Rest service to manage broker instance

Retrieves the details of broker configuration

Not implemented yet

Not implemented yet

Not implemented yet

/rest/authenticationprovider

/rest/authenticationprovider/<authentication provider name>

Rest service to manage authentication providers on the brokerRetrieves the details about authentication providersNot implemented yetNot implemented yetNot implemented yet

/rest/user

/rest/user/<authentication provider name>/<user name>

Rest service to manage user accountRetrieves the details about user accountCreates user accountUpdates user passwordDeletes user account

/rest/groupprovider

/rest/groupprovider/<group provider name>

Rest service to manage group providersRetrieves the details about group provider(s)Not implemented yetNot implemented yetNot implemented yet

/rest/group

/rest/group/<group provider name>/<group name>

Rest service to manage user groupRetrieves the details about user groupCreates groupNot implemented yetDeletes group

/rest/groupmember

/rest/groupmember/<group provider name >/<group name>/<user name>

Rest service to manage group member(s)Retrieves the details about group member(s)Add user to groupNot implemented yetDeletes user from group

/rest/port

/rest/port/<port name>

Rest service to manage broker ports(s)Retrieves the details about the broker port(s)Not implemented yetNot implemented yetNot implemented yet

/rest/port

/rest/port/<port name>

Rest service to manage broker ports(s)Retrieves the details about the broker port(s)Not implemented yetNot implemented yetNot implemented yet

/rest/queue

/rest/queue/<virtual host name>/>queue name>

Rest service to manage queue(s)Retrieves the details about the queue(s)Creates queueNot implemented yetDeletes queue

/rest/exchange

/rest/exchange/<virtual host name>/<exchange name>

Rest service to manage exchange(s)Retrieves the details about the exchange(s)Creates exchangeNot implemented yetDeletes exchange

/rest/binding

/rest/binding/<virtual host name>/<exchange name>/<queue name>/<binding name>

Rest service to manage binding(s)Retrieves the details about the binding(s)Binds a queue to an exchangeNot implemented yetDeletes binding

/rest/connection

/rest/connection/<virtual host name>/<connection name>

Rest service to manage connection(s)Retrieves the details about the connection(s)Not implemented yetNot implemented yetNot implemented yet

/rest/session

/rest/session/<virtual host name>/<connection name>/<session name>

Rest service to manage session(s)Retrieves the details about the session(s)Not implemented yetNot implemented yetNot implemented yet

/rest/message/*

Rest service to manage messages(s)Retrieves the details about the messages(s)Not implemented yetCopies, moves messagesDeletes messages

/rest/message-content/*

Rest service to retrieve message contentRetrieves the message contentNot implemented yetNot implemented yetNot implemented yet

/rest/logrecords

Rest service to retrieve broker logsRetrieves the broker logsNot implemented yetNot implemented yetNot implemented yet

/rest/sasl

Sasl authenticationRetrieves user current authentication status and broker supported SASL mechanismsAuthenticates user using supported SASL mechanismsNot implemented yetNot implemented yet

/rest/logout

Log outsLog outs userNot implemented yetNot implemented yetNot implemented yet

Rest URL are hierarchical. It is permitted to replace rest URL elements with an "asterisks" in GET requests to denote all object of a particular type. Additionally, trailing object type in the URL hierarchy can be omitted. In this case GET request will return all of the object underneath of the current object.

For example, for binding URL http://localhost:8080/rest/binding/<vhost>/<exchange>/<queue>/<binding> replacing of <exchange> with "asterisks" (http://localhost:8080/rest/binding/<vhost>/*/<queue>/<binding>) will result in the GET response containing the list of bindings for all of the exchanges in the virtual host having the given name and given queue. If <binding> and <queue> are omitted in binding REST URL (http://localhost:8080/rest/binding/<vhostname>/<exchangename>) the GET request will result in returning all bindings for all queues for the given exchange in the virtual host.

Example 9.5. Examples of queue creation using curl:

#create a durable queue
curl -X PUT  -d '{"durable":true}' http://localhost:8080/rest/queue/<vhostname>/<queuename>
#create a durable priority queue
curl -X PUT  -d '{"durable":true,"type":"priority"}' http://localhost:8080/rest/queue/<vhostname>/<queuename>
            

Example 9.6. Example of binding a queue to an exchange using curl

curl  -X PUT  -d '{}' http://localhost:8080/rest/binding/<vhostname>/<exchangename>/<queue-name>/<binding-name>
            

Qpid broker web management console calls rest interfaces internally to manage the broker.