Comments (9)
also no delete binding.
from pyrabbit.
` def delete_binding_exchange(self, vhost, exchange_source, exchange_destination, properties_key="~"):
"""
Deletes a binding between an exchange and an exchange on a given vhost.
:param string vhost: vhost housing the exchange/queue to bind
:param string exchange_source: the source exchange for the binding
:param string exchange_destination: the target exchange to bind to the source exchange
:param string properties_key: the routing key to use for the binding
"""
vhost = quote(vhost, '')
exchange_source = quote(exchange_source, '')
exchange_destination = quote(exchange_destination, '')
if properties_key == "~":
body = json.dumps({"vhost":vhost,"source":exchange_source,"destination_type":"e","destination":exchange_destination,"properties_key":""})
else:
body = json.dumps({"vhost":vhost,"source":exchange_source,"destination_type":"e","destination":exchange_destination,"properties_key":properties_key})
path = Client.urls['rt_bindings_between_exch_exch'] % (vhost,
exchange_source,
exchange_destination,
properties_key
)
return self.http.do_call(path, 'DELETE', body=body, headers=Client.json_headers)`
from pyrabbit.
` def create_binding_exchange(self, vhost, exchange_source, exchange_destination, properties_key="", args=None):
"""
Creates a binding between an exchange and an exchange on a given vhost.
:param string vhost: vhost housing the exchange/queue to bind
:param string exchange_source: the source exchange of the binding
:param string exchange_destination: the exchange to bind to the exchange
:param string properties_key: the routing key to use for the binding
:param list args: extra arguments to associate w/ the binding.
:returns: boolean
"""
vhost = quote(vhost, '')
exchange_source = quote(exchange_source, '')
exchange_destination = quote(exchange_destination, '')
body = json.dumps({"vhost":vhost,"source":exchange_source,"destination_type":"e","destination":exchange_destination,"properties_key": properties_key, "arguments":args or []})
path = Client.urls['bindings_between_exch_exch'] % (vhost,
exchange_source,
exchange_destination)
binding = self.http.do_call(path, 'POST', body=body,
headers=Client.json_headers)
return binding`
from pyrabbit.
I forgot to add the urls
add those between 86-87 line:
'bindings_between_exch_exch': 'bindings/%s/e/%s/e/%s',
'rt_bindings_between_exch_exch': 'bindings/%s/e/%s/e/%s/%s',
from pyrabbit.
please also add:
` def create_policy(self, vhost, name, pattern, apply_to, definition):
"""
Creates a policy to the server.
:param string vhost: vhost housing of the policy to be created.
:param string name: Name of the policy to be created.
:param string pattern: Pattern of the policy to be applied.
:param string apply_to: Apply to 'queues' or 'exchanges' or 'all'.
:param string definition: Definition of the policy to create.
"""
vhost = quote(vhost, '')
name = quote(name, '')
body = json.dumps({"vhost":vhost,"name":name,"pattern":pattern,"apply-to":apply_to,"definition": definition})
path = Client.urls['policies'] % (vhost,
name)
return self.http.do_call(path, 'PUT', body=body, headers=Client.json_headers)
def delete_policy(self, vhost, name):
"""
Deletes a policy from the server.
:param string vhost: vhost housing of the policy to delete
:param string name: Name of the policy to delete from the server.
"""
vhost = quote(vhost, '')
name = quote(name, '')
body = json.dumps({"vhost":vhost,"name":name,"component":"policy"})
path = Client.urls['policies'] % (vhost,
name)
return self.http.do_call(path, 'DELETE', body=body, headers=Client.json_headers)
`
and on the urls the 95 before the }
,'policies': 'policies/%s/%s'
from pyrabbit.
I'm a bit late to this party, but I have a fork that adds exchange to exchange bindings at https://github.com/chaos95/pyrabbit
from pyrabbit.
Yeap.. A bit. Can you make the change on yours?
from pyrabbit.
I'll take a crack at it; give me a day or two :)
from pyrabbit.
from pyrabbit.
Related Issues (20)
- Deleting binding does not work if routing-key contains hash HOT 1
- Printing api URL disturbs target application HOT 9
- Thread safety
- Unable to access RabbitMQ server over HTTPS connection HOT 1
- Rights management doesn't work well with vhosts HOT 1
- print in http HOT 2
- set_vhost_permissions in docker container HOT 1
- New release HOT 7
- set_vhost_permissions raises NetworkError HOT 2
- add get_node (node details)
- Breaking change?
- Can't connect, whoami fails? HOT 1
- Work with shovel plugin HOT 1
- documentation error: httplib2.ServerNotFoundError: Unable to find the server at http HOT 2
- pip not updated to latest commit HOT 1
- get_queue_depths prints lengths instead of returning them
- License on https://pypi.org/project/pyrabbit/ wrong
- Makes get queue size supports return only needed columns
- get_messages now requires 'ackmode' on request HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyrabbit.