DESCRIPTION

python rest client for membase node operations

python rest client class for membase managemtn node operations

-defined custom exception for membase node operations
there are error types (server_unreachable) or ( unauthorized_..)
or server_alreadu_joined. these except will let the test case
to take the right action or throw more descriptive error
-defined couple of structure to encapsulate basic types like
otpNode(id,status) or MembaseVersion(version)
-this rest client is not a comprehensive rest library. we add support
for more apis gradually.

Change-Id: I411e0f60a06af424fad170ed0b0bfcbe8b47f493


COMMENTS

author: Ayden Rivas
date: 2011-03-29 17:22:30.684000000

Patch Set 1: Verified; Looks good to me, approved

looks good, not submitting till httplib2 is pushed

-------------------------------------
author: Noah Dean
date: 2011-03-29 17:37:26.861000000

Patch Set 1: (2 inline comments)

I won't give it a -1, but there's a bit of reinvention here.

Line:21, lib/membase/api/rest_client.py -> You can rewrite this entire function like this:

    def is_cluster_healthy(self):
        return all(node.status == 'healthy' for node in nodes)

Line:118, lib/membase/api/rest_client.py -> Rewrite the above as

    ','.join(otpNodes)

-------------------------------------
author: Zackery Barr
date: 2011-03-29 20:27:28.259000000

Patch Set 1:

are you referring to the pyrest client used by the membase-cli ?

yeah.
this python rest wrapper code is a work in progress. I plan to add more error codes and exception types and redundant messages to this code to have better error detection/grouping in test cases.

This library should not be used by anyone else ( its not supposed to be a sdk library )

dont know whether it made any sense at this point since we still dont have a lot of tests using the library.

some methods like is_cluster_healthy will probably go away if I dont add any new functionality to it but we will see more funcs like monitor_rebalance() that gathers more stats and throws more specific exceptions types if possible for the test cases to catch and raise if need be.

-------------------------------------
