Create virtural hosts and users in a RabbitMQ Cluster.
- CLUSTERS: Comma seperated list of rabbitmq clusters. Ex: sandbox,live
- LIVE_RABBIT_AMQP: hostname to access queues in cluster 'live'. See below
- LIVE_RABBIT_URL: hostname to access management api in cluster 'live'.
- RABBITMQ_ADMIN_USERNAME: the admin username on the rabbitmq clusters
- RABBITMQ_ADMIN_PASSWORD: the admin password on the rabbitmq cluseters
- ENCRYPT_KEY: key used to set passwords in DB (24 characters)
- DATABASE_URL: broker db
- PORT: Port to access this api. Default is 3000 (See Go Martini)
- [CLUSTER_NAME]_RABBIT_URL - Api hostname (can be same as queue hostname)
- Ex: LIVE_RABBIT_URL=rabbitmq-prod.example.com
- Ex: SANDBOX_RABBIT_URL=rabbitmq-sandbox-api.example.io
- [CLUSTER_NAME]_RABBIT_AMQP - Queues hostname
- Ex: LIVE_RABBIT_AMQP=rabbitmq-prod.example.com
- Ex: SANDBOX_RABBIT_AMQP=rabbitmq-sandbox.example.io
Get a list of plans that can be used. The plans correlate to the cluster
names, so each cluster needs to be configured as a plan.
The defaults are sandbox and live.
URL : /v1/rabbitmq/plans
Method : GET
Code : 200 OK
Content
{
"live":"Prod and real use. Bigger cluster. Not purged",
"sandbox":"Dev and Testing and QA and Load testing. May be purged regularly"
}
Create a virtual host and user in the cluster from the plan.
URL : /v1/rabbitmq/instance
Method : POST
Data All fields required
{
"plan": "live",
"billingcode":"MyTeam"
}
Condition Virtual host and user created and added to database.
Code : 201 CREATED
Content
{
"RABBITMQ_URL":"amqp://username:password@rabbitmq-sandbox.example.io:5672/username"
}
Condition : Invalid plan or plan missing
Code : 400 Bad Request
Returned Response : None
URL : /v1/rabbitmq/url/:vhost
Method : GET
Condition : Virtual host found
Content :
{
"RABBITMQ_URL":"amqp://username:password@rabbitmq-sandbox.example.io:5672/vhost"
}
Condition : Virtual host not found
Code : 404 Not Found
URL : /v1/rabbitmq/instance/:vhost
URL Parameters : username=[string]
Method : DELETE
Condition : Virtual host and user deleted from database and rabbitmq cluster.
Code : 200 OK
Content : None
Condition : Virtual host not found in DB
Code : 404 Not Found
Content : None
URL : /v1/tag
Method : POST
Data :
- resource: virtual host name
- name: tag name
- value: tag value
{
"resource":"VHOST",
"name":"owner",
"value":"Captain Janeway"
}
Condition : Tag was added to virtual host in database
Code : 201 Created
Content :
{
"response":"tag added"
}
Condition : Vhost no in database
Code : 404 Not found
- Document structures and functions
- Add error handling