Re: [ceph-users] retrieving quota of ceph pool using librados or python API

2015-11-02 Thread Alex Leake
John,

Thank you very much! Works exactly as expected.


Kind Regards,
Alex.

From: John Spray 
Sent: 02 November 2015 13:19
To: Alex Leake
Cc: ceph-users@lists.ceph.com
Subject: Re: [ceph-users] retrieving quota of ceph pool using librados or 
python API

On Mon, Nov 2, 2015 at 9:39 PM, Alex Leake  wrote:
> Hello all,
>
>
> I'm attempting to use the python API to get the quota of a pool, but I can't
> see it in the documentation
> (http://docs.ceph.com/docs/v0.94/rados/api/python/).

The call you're looking for is Rados.mon_command, which seems to be
missing in the documentation for some reason.  This is the same
interface that the ceph CLI uses.

>>> r = rados.Rados(conffile="./ceph.conf")
>>> r.connect()
>>> json.loads(r.mon_command(json.dumps({"prefix": "osd pool get-quota", 
>>> "pool": "rbd", "format": "json-pretty"}), "")[1])
{u'pool_name': u'rbd', u'quota_max_objects': 0, u'quota_max_bytes': 0,
u'pool_id': 0}

Cheers,
John
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com


Re: [ceph-users] retrieving quota of ceph pool using librados or python API

2015-11-02 Thread John Spray
On Mon, Nov 2, 2015 at 9:39 PM, Alex Leake  wrote:
> Hello all,
>
>
> I'm attempting to use the python API to get the quota of a pool, but I can't
> see it in the documentation
> (http://docs.ceph.com/docs/v0.94/rados/api/python/).

The call you're looking for is Rados.mon_command, which seems to be
missing in the documentation for some reason.  This is the same
interface that the ceph CLI uses.

>>> r = rados.Rados(conffile="./ceph.conf")
>>> r.connect()
>>> json.loads(r.mon_command(json.dumps({"prefix": "osd pool get-quota", 
>>> "pool": "rbd", "format": "json-pretty"}), "")[1])
{u'pool_name': u'rbd', u'quota_max_objects': 0, u'quota_max_bytes': 0,
u'pool_id': 0}

Cheers,
John
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com


[ceph-users] retrieving quota of ceph pool using librados or python API

2015-11-02 Thread Alex Leake
Hello all,


I'm attempting to use the python API to get the quota of a pool, but I can't 
see it in the documentation (http://docs.ceph.com/docs/v0.94/rados/api/python/).


Does anyone know how to get the quota? (python or C). Without making a call to 
"ceph osd pool get-quota".


I am using ceph 0.94.2, under Ubuntu 14.04.



Kind Regards,

Alex.
___
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com