Coder Social home page Coder Social logo

rabbit_harness's Introduction

rabbit_harness

Small RabbitMQ administration library based on HTTP API Managment plugins.

Read this in other languages: English, Русский.

How it use

Create api instance:

from harness import Api
rmq_api = Api(host='127.0.0.1', user='guest', password='guest', scheme='http')

For testing you can up RabbitMQ using Docker: docker run -p 15672:15672 rabbitmq:3-management

Users

Get all users:

users = rmq_api.users.get_list()

or get a specific user:

user = rmq_api.users.get_detail('guest')

if user with this name not found, will be raised HTTPError.

For create user:

rmq_api.users.create(name='user_name', password='user_password')

Delete:

rmq_api.users.delete('user_name')
# or
user.delete()

It is possible to change password and/or tag:

user.change(password='test', tags='administrator')

also, you can set password hash:

user.change(password='itgX9uMVOgittIgB7yxFegDYcUNwuKBZyyg2QCW/uBAghTCf', password_hash=True)

Get all permissions or for specific vhost

permissions = user.permissions()
permission = user.permission(vhost='/')

and set/change it:

user.set_permission(read='test', write='', configure='.*')

if the permissions were set once, they can be updated in parts:

user.set_permission(write='ALL')

otherwise will be raised HTTPError.

rabbit_harness's People

Contributors

chud0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.