Giter Site home page Giter Site logo

python-jolokia's Issues

Rewrite set_attribute to explicitly accept list of attribute-value pairs

Currently, the set_attribute method can perform a bulk write if passed a list of attributes and :

def set_attribute(self, mbean=None, attribute=None, value=None, path=None, *args, **kwargs):
        """Sets the value of an MBean's attribute"""

        if not mbean or not attribute or not value:
            raise IllegalArgumentException('set_attribute method has 3 required parameters: mbean, attribute, and value')

        if type(attribute) is list and type(value) is dict:
            return self._bulk_write(mbean, attribute, value, **kwargs)
        elif (type(attribute) is list and type(value) is not dict) or (type(attribute) is not list and type(value) is dict):
            raise IllegalArgumentException('Bulk writes must include an attribute list and an attribute map')

This clunky and unintuitive. set_attribute should take an optional boolean called bulk and a list of attribute-value tuples as a co-requirement if bulk = True.

Multiple attributes in get_attribute returns only the first one

When passing in a list of attributes into get_attribute only the first attribute is returned. Looking in the source I see that a list of individual json payloads are generated and then sent.

I dont know if things have changed for jolokia since the birth of this project but this doesn't work as the return is only the first attribute supplied in the list. According to jolokia docs a json array of attributes is to be passed in, not a list of separate individual payloads of each attribute. I'm not sure if this is an in general thing or just because I'm dealing with AMQ and its a bit different.

In any case if you pass a comma separated string of your list as the attribute that also works and returns the bulk listing of all your attributes.

Authentication to Jolokia endpoint

Hi,
I looked both in documentation and source but can't seem to find how to do an authenticated call to the Jolokia endpoint. Is it a missing feature or does it have an implicit syntax?
Thanks,

Marco

DRY out tests

Currently, mock methods used to monkey patch requests.Session are repetitive1 and should be refactored according to the DRY principle.2

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.