RabbitMQ Management HTTP API--官方文档
Introduction
Apart from this help page, all URIs will serve only resources of type application/json, and will require HTTP basic authentication (using the standard RabbitMQ user database). The default user is guest/guest.
Many URIs require the name of a virtual host as part of the path, since names only uniquely identify objects within a virtual host. As the default virtual host is called "/", this will need to be encoded as "%2f".
PUTing a resource creates it. The JSON object you upload must have certain keys (documented below). Other keys are ignored. Missing keys consitute an error.
Since bindings do not have names or IDs in AMQP we synthesise one based on all its properties. Since predicting this name is hard in the general case, you can also create bindings by POSTing to a factory URI. See the example below.
Caveats
These caveats apply to the current development version of the management API. In future they will be fixed.
argumentsfields are ignored everywhere. You cannot create a queue, exchange or binding with arguments. Queues, exchanges or bindings with arguments won't show those arguments.- Permissions are only enforced sporadically. If a user can authenticate with the HTTP API, they can do anything.
- There are many monitoring-related information items in the objects returned from GET requests. They are undocumented and subject to change.
Examples
A few quick examples, using the Unix command line tool curl:
- Get a list of vhosts:
$ curl -i -u guest:guest http://localhost:55672/api/vhosts
HTTP/1.1 200 OK
Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)
Date: Tue, 31 Aug 2010 15:46:59 GMT
Content-Type: application/json
Content-Length: 5 ["/"] - Create a new vhost:
$ curl -i -u guest:guest -H "content-type:application/json" \
-XPUT http://localhost:55672/api/vhosts/foo
HTTP/1.1 204 No Content
Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)
Date: Fri, 27 Aug 2010 16:56:00 GMT
Content-Type: application/json
Content-Length: 0Note: you must specify
application/jsonas the mime type.Note: the name of the object is not needed in the JSON object uploaded, since it is in the URI. As a virtual host has no properties apart from its name, this means you do not need to specify a body at all!
- Create a new exchange in the default virtual host:
$ curl -i -u guest:guest -H "content-type:application/json" \
-XPUT -d'{"type":"direct","auto_delete":false,"durable":true,"arguments":[]}' \
http://localhost:55672/api/exchanges/%2f/my-new-exchange
HTTP/1.1 204 No Content
Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)
Date: Fri, 27 Aug 2010 17:04:29 GMT
Content-Type: application/json
Content-Length: 0Note: we never return a body in response to a PUT or DELETE, unless it fails.
- And delete it again:
$ curl -i -u guest:guest -H "content-type:application/json" \
-XDELETE http://localhost:55672/api/exchanges/%2f/my-new-exchange
HTTP/1.1 204 No Content
Server: MochiWeb/1.1 WebMachine/1.7 (participate in the frantic)
Date: Fri, 27 Aug 2010 17:05:30 GMT
Content-Type: application/json
Content-Length: 0
Reference
| GET | PUT | DELETE | POST | Path | Description |
|---|---|---|---|---|---|
| X | /api/overview | Various random bits of information that describe the whole system. | |||
| X | /api/connections | A list of all open connections. | |||
| X | X | /api/connections/name | An individual connection. DELETEing it will close the connection. | ||
| X | /api/channels | A list of all open channels. | |||
| X | /api/channels/channel | Details about an individual channel. | |||
| X | /api/exchanges | A list of all exchanges. | |||
| X | /api/exchanges/vhost | A list of all exchanges in a given virtual host. | |||
| X | X | X | /api/exchanges/vhost/name | An individual exchange. To PUT an exchange, you will need a body looking something like this:
{"type":"direct","auto_delete":false,"durable":true,"arguments":[]}
|
|
| X | /api/exchanges/vhost/name/bindings | A list of all bindings on a given exchange. | |||
| X | /api/queues | A list of all queues. | |||
| X | /api/queues/vhost | A list of all queues in a given virtual host. | |||
| X | X | X | /api/queues/vhost/name | An individual queue. To PUT a queue, you will need a body looking something like this:
{"auto_delete":false,"durable":true,"arguments":[]}
|
|
| X | /api/queues/vhost/queue/bindings | A list of all bindings on a given queue. | |||
| X | /api/bindings | A list of all bindings. | |||
| X | /api/bindings/vhost | A list of all bindings in a given virtual host. | |||
| X | X | /api/bindings/vhost/queue/exchange | A list of all bindings between a queue and an exchange. Remember, a queue and an exchange can be bound together many times! To create a new binding, POST to this URI. You will need a body looking something like this:
{"routing_key":"my_routing_key","arguments":[]}
The response will contain a |
||
| X | X | X | /api/bindings/vhost/queue/exchange/props | An individual binding between a queue and an exchange. The props part of the URI is a "name" for the binding composed of its routing key and properties. While you can create a binding by PUTing to this URI, it may be more convenient to POST to the URI above. | |
| X | /api/vhosts | A list of all vhosts. | |||
| X | X | X | /api/vhosts/name | An individual virtual host. As a virtual host only has a name, you do not need an HTTP body when PUTing one of these. | |
| X | /api/users | A list of all users. | |||
| X | X | X | /api/users/name | An individual user. To PUT a user, you will need a body looking something like this:
{"password":"secret"}
|
|
| X | /api/users/user/permissions | A list of all permissions for a given user. | |||
| X | /api/permissions | A list of all permissions for all users. | |||
| X | X | X | /api/permissions/vhost/user | An individual permission of a user and virtual host. To PUT a permission, you will need a body looking something like this:
{"scope":"client","configure":".*","write":".*","read":".*"}
|
原文地址:http://hg.rabbitmq.com/rabbitmq-management/raw-file/3646dee55e02/priv/www-api/help.html
RabbitMQ Management HTTP API--官方文档的更多相关文章
- SolrJ API 官方文档最佳实践
以下内容译自Solr Wiki官方文档,版权没有,随意转载. Solrj 是一个访问solr的Java客户端.它提供了一个java接口用于添加更新和查询solr索引.本页面介绍SolrJ最新版本1.4 ...
- 【Android API】Android 4.1 API官方文档详解
原文:http://android.eoe.cn/topic/summary 翻译:[eoeAndroid原创团队]kris.流风而逝.贼寇在何方.snowxwyo.lsy4833406 更新日期:2 ...
- 《Spark Python API 官方文档中文版》 之 pyspark.sql (一)
摘要:在Spark开发中,由于需要用Python实现,发现API与Scala的略有不同,而Python API的中文资料相对很少.每次去查英文版API的说明相对比较慢,还是中文版比较容易get到所需, ...
- 《Spark Python API 官方文档中文版》 之 pyspark.sql (二)
摘要:在Spark开发中,由于需要用Python实现,发现API与Scala的略有不同,而Python API的中文资料相对很少.每次去查英文版API的说明相对比较慢,还是中文版比较容易get到所需, ...
- 《Spark Python API 官方文档中文版》 之 pyspark.sql (四)
摘要:在Spark开发中,由于需要用Python实现,发现API与Scala的略有不同,而Python API的中文资料相对很少.每次去查英文版API的说明相对比较慢,还是中文版比较容易get到所需, ...
- 《Spark Python API 官方文档中文版》 之 pyspark.sql (三)
摘要:在Spark开发中,由于需要用Python实现,发现API与Scala的略有不同,而Python API的中文资料相对很少.每次去查英文版API的说明相对比较慢,还是中文版比较容易get到所需, ...
- Restful API官方文档
理解Restful架构:http://www.ruanyifeng.com/blog/2011/09/restful RESTful设计指南:http://www.ruanyifeng.com/blo ...
- Search API 官方文档 可以用了查看自己的app
Search API October 24, 2012 - HTTPS is now supported for Search and Lookup requests. Please update y ...
- ElasticSearch(6.2.2)的java API官方文档的总结 (三)
一 : SearchRequest用于任何与搜索文档,聚合和建议有关的操作,并且还提供了对生成的文档进行高亮显示的方法. 在最基本的形式中,我们可以向请求添加一个查询: 1:添加一个Search ...
- lua api 官方文档 函数后面的方括号 说明 [-0, +0, –]
本博客注有“转”字样的为转载文章,其余为本人原创文章,转载请务必注明出处或保存此段.c++/lua/windows逆向交流群:69148232 每一个lua api 函数结尾都给出了这样的说明例如: ...
随机推荐
- <和>
今天用到>查了查资料就是这么个回事.
- Ajax实现的长轮询不阻塞同一时间内页面的其他Ajax请求(同域请求)
最近要做一个来电的弹屏功能,利用OM 系统的接口,OM系统发送请求到接口程序,分析数据添加到mysql数据库中,然后把最新的数据id 跟今日来电的总的数量存储到memcache 中.弹屏程序根据读取的 ...
- flask request
请求对象要操作 URL (如 ?key=value )中提交的参数可以使用 args 属性:searchword = request.args.get('key', '')用户可能会改变 URL 导致 ...
- 那些年被我坑过的Python——道阻且长(第五章实用模块讲解)
random模块 我的随机验证吗程序: 首先保证了字母和数字出现的概率是50% VS 50%,其次是可以订制输出多少位 def Captcha(size): Captcha_list = [] for ...
- 再次探究Android ListView缓存机制
概述 虽然现在5.0后Google推出了RecycleView,但在5.0 Lollipop普及前Listview仍会被广泛使用,所以打算再次探究一下Listview的源码,了解一下Listview ...
- 新建maven project遇到的问题
在m2e安装成功之后,开始创建maven project了,但是出现了如下错误: 结果在很偶然的情况下让我解决了,就是更新下m2.respository,点击下图中的Update Settings -
- 架设wordpress再vps上的 一些感想总结
日本vps.樱花系列 配置: 2cpu+1G内存+100G硬盘 系统 第一次我把默认的centos 给换了..原因就是,不会linux.而且我主要用.net 感觉 mono也行.但是linux不会. ...
- BZOJ 1038 瞭望塔
Description 致力于建设全国示范和谐小村庄的H村村长dadzhi,决定在村中建立一个瞭望塔,以此加强村中的治安.我们将H村抽象为一维的轮廓.如下图所示 我们可以用一条山的上方轮廓折线(x1, ...
- 如何开发Android Wear应用程序
Android Wear是连接安卓手机和可穿戴产品的一个平台.自从今年上半年发布以来,Android Wear获得了大量关注,既有来自消费者的关注,也有来自开发商的关注,后者希望自己的应用程序已经准备 ...
- UVA-10735 - Euler Circuit(混合欧拉回路输出)
题意:给你一个图,有N个点,M条边,这M条边有的是单向的,有的是双向的. 问你能否找出一条欧拉回路,使得每条边都只经过一次! 分析: 下面转自别人的题解: 把该图的无向边随便定向,然后计算每个点的入度 ...