On 04/19/2018 09:19 PM, Adrian Turjak wrote:
On 20/04/18 01:46, Chris Friesen wrote:
On 04/19/2018 07:01 AM, Jeremy Stanley wrote:

Or, for that matter, leverage OpenStackSDK's ability to pass
arbitrary calls to individual service APIs when you need something
not exposed by the porcelain layer.

Is that documented somewhere?  I spent some time looking at
https://docs.openstack.org/openstacksdk/latest/ and didn't see
anything that looked like that.

Not that I believe, but basically it amounts to that on any service
proxy object you can call .get .post etc. So if the SDK doesn't yet
support a given feature, you can still use the feature yourself, but you
need to do some raw requests work, which honestly isn't that bad.

servers = list(conn.compute.servers())
vs
servers_resp = conn.compute.get("/servers")

I think the second statement above is not quite right.

>>> from openstack import connection
>>> conn = connection.Connection(auth_url=....)
>>> [flavor.name for flavor in conn.compute.flavors()]
[u'small', u'medium']
>>> conn.compute.get("/servers")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'Proxy' object has no attribute 'get'

Chris

_______________________________________________
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to     : [email protected]
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

Reply via email to