You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@libcloud.apache.org by Sengor <se...@gmail.com> on 2011/01/13 05:16:05 UTC

[libcloud] Custom API queries

Hi guys,

Is it safe enough (long term interface wise) to utilise this mechanism
for sending custom queries to cloud provider APIs?

Example:
>>> from libcloud.types import Provider
>>> from libcloud.providers import get_driver
>>> from libcloud.drivers import ibm_sbc
>>> d=get_driver(Provider.IBM)
>>> c=d("username", "password")
>>> c.connection.request(ibm_sbc.REST_BASE+'/keys').body
'<?xml version="1.0"...>'

Where '/keys' could be an arbitrary REST API call.

Thank you.

-- 
sengork

Re: [libcloud] Custom API queries

Posted by Sengor <se...@gmail.com>.
I agree in principle, however given:
- various cloud APIs are far from being standardised
- providers seem to add new/custom features to their respective APIs
across versions

it'd be of practical use to have a generic/freeform low level REST API
interface exposed via the NodeDriver. Even for the sake of provider
specific point-in-time API debugging.

On Thu, Jan 13, 2011 at 4:30 PM, Paul Querna <pa...@querna.org> wrote:
> On Wed, Jan 12, 2011 at 8:16 PM, Sengor <se...@gmail.com> wrote:
>> Hi guys,
>>
>> Is it safe enough (long term interface wise) to utilise this mechanism
>> for sending custom queries to cloud provider APIs?
>>
>> Example:
>>>>> from libcloud.types import Provider
>>>>> from libcloud.providers import get_driver
>>>>> from libcloud.drivers import ibm_sbc
>>>>> d=get_driver(Provider.IBM)
>>>>> c=d("username", "password")
>>>>> c.connection.request(ibm_sbc.REST_BASE+'/keys').body
>> '<?xml version="1.0"...>'
>>
>> Where '/keys' could be an arbitrary REST API call.
>>
>
> It would be better to wrap most of these in ex_ prefix APIs on the
> main driver object -- while I dont think there is a plan to rewrite
> connection any time soon, relying on it seems very much like a
> non-public API -- it would be best to just submit patches for adding
> more things, see the rackspace or amazon drivers for example, they
> have many extension apis.
>
> Thanks,
>
> Paul
>



-- 
sengork

Re: [libcloud] Custom API queries

Posted by Paul Querna <pa...@querna.org>.
On Wed, Jan 12, 2011 at 8:16 PM, Sengor <se...@gmail.com> wrote:
> Hi guys,
>
> Is it safe enough (long term interface wise) to utilise this mechanism
> for sending custom queries to cloud provider APIs?
>
> Example:
>>>> from libcloud.types import Provider
>>>> from libcloud.providers import get_driver
>>>> from libcloud.drivers import ibm_sbc
>>>> d=get_driver(Provider.IBM)
>>>> c=d("username", "password")
>>>> c.connection.request(ibm_sbc.REST_BASE+'/keys').body
> '<?xml version="1.0"...>'
>
> Where '/keys' could be an arbitrary REST API call.
>

It would be better to wrap most of these in ex_ prefix APIs on the
main driver object -- while I dont think there is a plan to rewrite
connection any time soon, relying on it seems very much like a
non-public API -- it would be best to just submit patches for adding
more things, see the rackspace or amazon drivers for example, they
have many extension apis.

Thanks,

Paul