Last active
January 30, 2018 04:38
-
-
Save Asitha/256b98da7e538a41fd268a13d1372fc7 to your computer and use it in GitHub Desktop.
Message Broker Admin API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swagger: '2.0' | |
info: | |
version: 1.0.0 | |
title: Broker Admin API | |
description: Message Broker Management API | |
license: | |
name: Apache 2.0 | |
url: 'http://www.apache.org/licenses/LICENSE-2.0.html' | |
schemes: | |
- https | |
- http | |
basePath: /broker/v.1.0 | |
produces: | |
- application/json | |
paths: | |
/queues: | |
get: | |
operationId: getAllQueues | |
summary: Get all queues | |
description: | | |
Gets metadata of all the queues in the broker. This includes durable | |
and non durable queues. | |
produces: | |
- application/json | |
parameters: | |
- in: query | |
name: durable | |
type: boolean | |
required: false | |
description: filter queues by durability | |
responses: | |
'200': | |
description: List of queues | |
schema: | |
type: array | |
items: | |
$ref: '#/definitions/QueueMetadata' | |
post: | |
operationId: createQueue | |
summary: Creates a queue | |
consumes: | |
- application/json | |
parameters: | |
- in: body | |
name: body | |
description: Queue create request | |
required: true | |
schema: | |
$ref: '#/definitions/QueueCreateRequest' | |
responses: | |
'201': | |
description: Queue created. | |
schema: | |
$ref: '#/definitions/QueueCreateResponse' | |
'400': | |
description: Bad Request. Invalid request or validation error. | |
schema: | |
$ref: '#/definitions/Error' | |
'415': | |
description: >- | |
Unsupported media type. The entity of the request was in a not | |
supported format. | |
schema: | |
$ref: '#/definitions/Error' | |
/queues/{name}: | |
parameters: | |
- in: path | |
name: name | |
type: string | |
required: true | |
description: Name of the queue | |
get: | |
operationId: getQueue | |
summary: Get a specific queue | |
description: Gets metadata of the specified queue. | |
responses: | |
'200': | |
description: Metadata of the queue | |
schema: | |
$ref: '#/definitions/QueueMetadata' | |
'404': | |
description: Queue not found | |
schema: | |
$ref: '#/definitions/Error' | |
delete: | |
operationId: deleteQueue | |
summary: Delete the specified queue. | |
description: >- | |
Delete the specified queue if the queue exists in the broker and the | |
query param properties ifUnused and ifEmpty are satisfied. | |
produces: | |
- application/json | |
parameters: | |
- in: query | |
name: ifUnused | |
type: boolean | |
required: false | |
default: true | |
description: >- | |
If set to true, queue will be deleted only if the queue has no | |
active consumers. | |
- in: query | |
name: ifEmpty | |
type: boolean | |
required: false | |
default: true | |
description: 'If set to true, queue will be deleted only if the queue is empty.' | |
responses: | |
'200': | |
description: Queue deleted | |
'400': | |
description: Bad request. Invalid request or validation error. | |
schema: | |
$ref: '#/definitions/Error' | |
'404': | |
description: Queue not found | |
schema: | |
$ref: '#/definitions/Error' | |
/queues/{name}/consumers: | |
get: | |
operationId: getAllConsumersForQueue | |
summary: Get all consumers of a queue | |
description: Retrieves all the consumers for the queue | |
parameters: | |
- in: path | |
name: name | |
type: string | |
required: true | |
description: Name of the queue | |
produces: | |
- application/json | |
responses: | |
'200': | |
description: Consumers of the queue | |
schema: | |
type: array | |
items: | |
$ref: '#/definitions/ConsumerMetadata' | |
'404': | |
description: Queue not found | |
schema: | |
$ref: '#/definitions/Error' | |
/queues/{name}/consumers/{consumerId}: | |
parameters: | |
- in: path | |
name: name | |
type: string | |
required: true | |
description: Name of the queue | |
- in: path | |
name: consumerId | |
type: integer | |
required: true | |
description: Unique consumer identifier | |
get: | |
operationId: getConsumer | |
summary: Get a specific consumer | |
description: Retrieves a specific consumer for a given queue | |
produces: | |
- application/json | |
responses: | |
'200': | |
description: Consumers of the queue | |
schema: | |
$ref: '#/definitions/ConsumerMetadata' | |
'404': | |
description: Queue/Consumer not found | |
schema: | |
$ref: '#/definitions/Error' | |
delete: | |
operationId: deleteConsumer | |
summary: delete a consumer | |
description: Delete a specific consumer from a queue | |
responses: | |
'200': | |
description: Consumer deleted | |
'404': | |
description: Queue/Consumer not found | |
schema: | |
$ref: '#/definitions/Error' | |
/queues/{name}/bindings: | |
post: | |
operationId: createBinding | |
summary: Create a binding | |
description: Create a binding for a queue | |
consumes: | |
- application/json | |
parameters: | |
- in: path | |
name: name | |
type: string | |
required: true | |
description: Name of the queue to bind to | |
- in: body | |
name: body | |
required: true | |
description: Payload of binding creation request | |
schema: | |
$ref: '#/definitions/BindingCreateRequest' | |
responses: | |
'201': | |
description: Binding created | |
schema: | |
$ref: '#/definitions/BindingCreateResponse' | |
'400': | |
description: Bad Request. Invalid request or validation error. | |
schema: | |
$ref: '#/definitions/Error' | |
'415': | |
description: >- | |
Unsupported media type. The entity of the request was in a not | |
supported format. | |
schema: | |
$ref: '#/definitions/Error' | |
'404': | |
description: Exchange not found | |
schema: | |
$ref: '#/definitions/Error' | |
/queues/{name}/bindings/{bindingPattern}: | |
parameters: | |
- in: path | |
name: name | |
type: string | |
required: true | |
description: Name of the queue | |
- in: path | |
name: bindingPattern | |
type: string | |
required: true | |
description: Binding pattern for the bindings | |
- in: query | |
name: filterExpression | |
type: string | |
required: false | |
description: JMS selector relater message filter pattern | |
delete: | |
operationId: deleteBinding | |
summary: Unbind a queue | |
description: Delete a specific binding | |
produces: | |
- application/json | |
responses: | |
'200': | |
description: Binding deleted | |
'400': | |
description: Bad request. Invalid request or validation error. | |
schema: | |
$ref: '#/definitions/Error' | |
'404': | |
description: Binding not found | |
schema: | |
$ref: '#/definitions/Error' | |
get: | |
operationId: getBinding | |
summary: Retrieve bindings for a queue with specific binding pattern | |
produces: | |
- application/json | |
responses: | |
'200': | |
description: Binding info | |
schema: | |
$ref: '#/definitions/BindingInfo' | |
'404': | |
description: Exchange not found | |
schema: | |
$ref: '#/definitions/Error' | |
/exchanges: | |
get: | |
operationId: getAllExchanges | |
summary: Get all exchanges | |
description: Retrieves all the exchanges in the broker | |
produces: | |
- application/json | |
responses: | |
'200': | |
description: List of exchanges | |
schema: | |
type: array | |
items: | |
$ref: '#/definitions/ExchangeMetadata' | |
post: | |
operationId: createExchange | |
summary: Create an exchange | |
consumes: | |
- application/json | |
parameters: | |
- in: body | |
name: body | |
description: Exchange create request | |
required: true | |
schema: | |
$ref: '#/definitions/ExchangeCreateRequest' | |
responses: | |
'201': | |
description: Exchange created | |
schema: | |
$ref: '#/definitions/ExchangeCreateResponse' | |
'400': | |
description: Bad Request. Invalid request or validation error. | |
schema: | |
$ref: '#/definitions/Error' | |
'415': | |
description: >- | |
Unsupported media type. The entity of the request was in a not | |
supported format. | |
schema: | |
$ref: '#/definitions/Error' | |
/exchanges/{name}: | |
parameters: | |
- in: path | |
name: name | |
type: string | |
required: true | |
description: Name of the exchange. | |
get: | |
operationId: getExchange | |
summary: Get a specific exchange | |
description: Retrieves the exchange metadata for the specific exchange | |
produces: | |
- application/json | |
responses: | |
'200': | |
description: Metadata of the exchange | |
schema: | |
$ref: '#/definitions/ExchangeMetadata' | |
'404': | |
description: Exchange not found | |
schema: | |
$ref: '#/definitions/Error' | |
delete: | |
operationId: deleteExchange | |
summary: Delete exchnage | |
description: Delete the exchange with the specified exchange name | |
parameters: | |
- in: query | |
name: ifUnused | |
type: boolean | |
required: false | |
description: Delete if the exchange has no bindings. | |
default: true | |
responses: | |
'200': | |
description: Exchange deleted | |
'400': | |
description: Bad request. Invalid request or validation error. | |
schema: | |
$ref: '#/definitions/Error' | |
'404': | |
description: Exchange not found | |
schema: | |
$ref: '#/definitions/Error' | |
'/exchanges/{name}/bindings': | |
parameters: | |
- in: path | |
name: name | |
type: string | |
required: true | |
description: Name of the exchange. | |
get: | |
operationId: getAllBindingsForExchange | |
summary: Get bindings of a exchange | |
description: Retrieves the bindings set of the exchange | |
produces: | |
- application/json | |
responses: | |
'200': | |
description: List of Bindings | |
schema: | |
type: array | |
items: | |
$ref: '#/definitions/BindingSetInfo' | |
'404': | |
description: Exchange not found | |
schema: | |
$ref: '#/definitions/Error' | |
definitions: | |
ConsumerMetadata: | |
title: Consumer Metadata | |
type: object | |
required: | |
- id | |
- consumerTag | |
- flowEnabled | |
- isExclusive | |
properties: | |
id: | |
type: integer | |
description: unique id of the consumer | |
consumerTag: | |
type: string | |
description: identifier given by the channel | |
isExclusive: | |
type: boolean | |
description: State whether only this consumer can consume from the queue. | |
flowEnabled: | |
type: boolean | |
description: State whether the consumers is actively consuming messages | |
QueueCreateRequest: | |
title: Queue Create Request | |
type: object | |
required: | |
- name | |
- durable | |
- autoDelete | |
properties: | |
name: | |
type: string | |
description: Name of the queue to be created | |
durable: | |
type: boolean | |
description: 'True if the queue is durable, false otherwise' | |
autoDelete: | |
type: boolean | |
description: deletes the queue when there are no consumers for the queue. | |
QueueMetadata: | |
title: Queue Metadata | |
type: object | |
required: | |
- name | |
- consumerCount | |
- durable | |
- capacity | |
- size | |
- autoDelete | |
properties: | |
name: | |
type: string | |
description: Name of the queue. This is a unique value | |
consumerCount: | |
type: integer | |
description: >- | |
number of active consumers assigned to the queue. Messages will be | |
dispatched in a round robing manner to the consumers. | |
durable: | |
type: boolean | |
description: >- | |
durability of the queue. True if the queue is durable and false | |
otherwise. Durable queues will survive node failures. | |
capacity: | |
type: integer | |
description: >- | |
Maximum number of messages the queue can hold. Durable queues are | |
unbounded and will specify the integer max value (2,147,483,647) as | |
the capacity. | |
size: | |
type: integer | |
description: Number of messages in the queue. | |
autoDelete: | |
type: boolean | |
description: >- | |
If set to true queue will get deleted once all the consumers of the | |
queue get disconnected. | |
QueueCreateResponse: | |
title: Queue Create Response | |
type: object | |
required: | |
- message | |
properties: | |
message: | |
type: string | |
description: Response message with status of the queue create operation. | |
ExchangeMetadata: | |
title: Exchange Metadata | |
type: object | |
properties: | |
name: | |
type: string | |
description: Name of the exchange | |
type: | |
type: string | |
description: 'Type of exchange. for instance amq.direct, amq.topic' | |
durable: | |
type: boolean | |
description: True if the exchange is durable and false otherwise | |
ExchangeCreateRequest: | |
title: Exchange Create Request | |
type: object | |
required: | |
- name | |
- type | |
- durable | |
properties: | |
name: | |
type: string | |
description: Name of the exchange. This should be a unique value | |
type: | |
type: string | |
description: Type of exchange | |
durable: | |
type: boolean | |
description: States whether the exchange is durable or not | |
ExchangeCreateResponse: | |
title: Exchange Create Response | |
type: object | |
required: | |
- message | |
properties: | |
message: | |
type: string | |
description: Response message with status of the exchange create operation. | |
BindingSetInfo: | |
title: Bindings for a given routing pattern | |
type: object | |
properties: | |
bindingPattern: | |
type: string | |
description: Binding pattern used for routing messages | |
bindings: | |
type: array | |
description: Set of bindings for a given routing key | |
items: | |
type: object | |
properties: | |
queueName: | |
type: string | |
description: Bound queue name | |
filterExpression: | |
type: string | |
description: JMS selector relater message filter pattern | |
BindingInfo: | |
title: Binding Information | |
type: object | |
required: | |
- bindingPattern | |
properties: | |
bindingPattern: | |
type: string | |
description: Routing pattern of the binding | |
queueName: | |
type: string | |
description: Bound queue name | |
filterExpression: | |
type: string | |
description: message filtering expression | |
BindingCreateRequest: | |
title: Binding Create Request | |
type: object | |
required: | |
- bindingPattern | |
properties: | |
bindingPattern: | |
type: string | |
description: Binding pattern that should routing keys | |
filterExpression: | |
type: string | |
description: JMS selector relater message filter pattern | |
BindingCreateResponse: | |
title: Binding Create Response | |
type: object | |
required: | |
- message | |
properties: | |
message: | |
type: string | |
description: Response message with status of the binding create operation. | |
Error: | |
title: Error Response | |
required: | |
- code | |
- message | |
properties: | |
code: | |
type: integer | |
format: int64 | |
message: | |
type: string | |
description: Error message. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment