Re: [Openstack] which SDK to use?
On 2018-04-17 15:38:03 +0300 (+0300), Volodymyr Litovka wrote: [...] > 1) Openstack SDK (https://docs.openstack.org/openstacksdk/latest ) > 2) Openstack Clients (https://wiki.openstack.org/wiki/OpenStackClients ) > > The question is which one to use in terms of support Openstack APIs, > development longevity and consistency with Openstack development? [...] The unified OpenStackSDK is intended as a general, flexible yet consistent programming interface for consumers of a variety of OpenStack services and environments, and this is where most of the innovation you seem to be asking about is happening so is probably a much better choice. The various "client libraries" (e.g. python-novaclient, python-cinderclient, et cetera) can also be used to that end, but are mostly for service-to-service communication these days, aren't extremely consistent with each other, and tend to eventually drop support for older OpenStack APIs so if you're going to be interacting with a variety of different OpenStack deployments built on different releases you may need multiple versions of the client libraries (depending on what it is you're trying to do). -- Jeremy Stanley signature.asc Description: PGP signature ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
On 04/17/2018 07:13 AM, Jeremy Stanley wrote: The various "client libraries" (e.g. python-novaclient, python-cinderclient, et cetera) can also be used to that end, but are mostly for service-to-service communication these days, aren't extremely consistent with each other, and tend to eventually drop support for older OpenStack APIs so if you're going to be interacting with a variety of different OpenStack deployments built on different releases you may need multiple versions of the client libraries (depending on what it is you're trying to do). The above is all good information. I'd like to add that if you need bleeding-edge functionality in nova it will often be implemented first in python-novaclient. Chris ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
Hi Chris and colleagues, based on your experience, can you specify an average delay between new OS release / new feature introduction and appearance of corresponding support in Unified Openstack SDK if you were experiencing such issues? Thanks. On 4/17/18 7:23 PM, Chris Friesen wrote: On 04/17/2018 07:13 AM, Jeremy Stanley wrote: The various "client libraries" (e.g. python-novaclient, python-cinderclient, et cetera) can also be used to that end, but are mostly for service-to-service communication these days, aren't extremely consistent with each other, and tend to eventually drop support for older OpenStack APIs so if you're going to be interacting with a variety of different OpenStack deployments built on different releases you may need multiple versions of the client libraries (depending on what it is you're trying to do). The above is all good information. I'd like to add that if you need bleeding-edge functionality in nova it will often be implemented first in python-novaclient. Chris ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack -- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
I should preface this with the fact that I don't use OpenStack SDK, so you may want to check with the project developers. One example is that a bit over a year ago nova added a microversion to include the flavor information directly in the server information rather than returning a link to a flavor (that may have been modified or deleted in the meantime). To my knowledge, the Openstack SDK does not yet support this functionality. Chris On 04/17/2018 02:24 PM, Volodymyr Litovka wrote: Hi Chris and colleagues, based on your experience, can you specify an average delay between new OS release / new feature introduction and appearance of corresponding support in Unified Openstack SDK if you were experiencing such issues? Thanks. On 4/17/18 7:23 PM, Chris Friesen wrote: On 04/17/2018 07:13 AM, Jeremy Stanley wrote: The various "client libraries" (e.g. python-novaclient, python-cinderclient, et cetera) can also be used to that end, but are mostly for service-to-service communication these days, aren't extremely consistent with each other, and tend to eventually drop support for older OpenStack APIs so if you're going to be interacting with a variety of different OpenStack deployments built on different releases you may need multiple versions of the client libraries (depending on what it is you're trying to do). The above is all good information. I'd like to add that if you need bleeding-edge functionality in nova it will often be implemented first in python-novaclient. Chris ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
There is also nothing stopping you from using both. For example, you could use the OpenStack SDK for most things but if you hit an edge case where you need something specific you can then import the particular client lib. Cheers, Josh On Thu, Apr 19, 2018 at 1:05 AM, Chris Friesen wrote: > I should preface this with the fact that I don't use OpenStack SDK, so you > may want to check with the project developers. > > One example is that a bit over a year ago nova added a microversion to > include the flavor information directly in the server information rather > than returning a link to a flavor (that may have been modified or deleted > in the meantime). > > To my knowledge, the Openstack SDK does not yet support this functionality. > > Chris > > > > On 04/17/2018 02:24 PM, Volodymyr Litovka wrote: > >> Hi Chris and colleagues, >> >> based on your experience, can you specify an average delay between new OS >> release / new feature introduction and appearance of corresponding >> support in >> Unified Openstack SDK if you were experiencing such issues? >> >> Thanks. >> >> On 4/17/18 7:23 PM, Chris Friesen wrote: >> >>> On 04/17/2018 07:13 AM, Jeremy Stanley wrote: >>> >>> The various "client libraries" (e.g. python-novaclient, python-cinderclient, et cetera) can also be used to that end, but are mostly for service-to-service communication these days, aren't extremely consistent with each other, and tend to eventually drop support for older OpenStack APIs so if you're going to be interacting with a variety of different OpenStack deployments built on different releases you may need multiple versions of the client libraries (depending on what it is you're trying to do). >>> >>> The above is all good information. >>> >>> I'd like to add that if you need bleeding-edge functionality in nova it >>> will >>> often be implemented first in python-novaclient. >>> >>> Chris >>> >>> ___ >>> Mailing list: http://lists.openstack.org/cgi >>> -bin/mailman/listinfo/openstack >>> Post to : openstack@lists.openstack.org >>> Unsubscribe : http://lists.openstack.org/cgi >>> -bin/mailman/listinfo/openstack >>> >> >> > > ___ > Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstac > k > Post to : openstack@lists.openstack.org > Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstac > k > ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
On 2018-04-19 12:24:48 +1000 (+1000), Joshua Hesketh wrote: > There is also nothing stopping you from using both. For example, > you could use the OpenStack SDK for most things but if you hit an > edge case where you need something specific you can then import > the particular client lib. [...] 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. -- Jeremy Stanley signature.asc Description: PGP signature ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
On 04/19/2018 07:01 AM, Jeremy Stanley wrote: On 2018-04-19 12:24:48 +1000 (+1000), Joshua Hesketh wrote: There is also nothing stopping you from using both. For example, you could use the OpenStack SDK for most things but if you hit an edge case where you need something specific you can then import the particular client lib. [...] 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. Thanks, Chris ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
As someone who used to use all the standalone clients, I'm leaning very heavily these days to using only the SDK and think we should encourage most projects to treat the SDK as their first point of implementation rather than all the wildly different python clients. So if you are new to OpenStack, the the SDK is the best and most consistent option right now for interacting with OpenStack from python. Sadly though the docs are lacking, but the docs for the other libraries aren't that much better anyway half the time. On 20/04/18 01:46, Chris Friesen wrote: > On 04/19/2018 07:01 AM, Jeremy Stanley wrote: >> On 2018-04-19 12:24:48 +1000 (+1000), Joshua Hesketh wrote: >>> There is also nothing stopping you from using both. For example, >>> you could use the OpenStack SDK for most things but if you hit an >>> edge case where you need something specific you can then import >>> the particular client lib. >> [...] >> >> 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") The direct calls on the proxy object use your current session (auth and scope) against the endpoint specific to that service, and just return the raw request itself when called directly. This works even for Swift where the url has to include details about your account. It's surprisingly elegant. Ideally when people use the SDK like this they should also submit a patch to fill in the missing functionality. Adding to the SDK isn't that bad and the codebase is much better than it used to be. > Thanks, > Chris > > ___ > Mailing list: > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack > Post to : openstack@lists.openstack.org > Unsubscribe : > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
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 "", line 1, in AttributeError: 'Proxy' object has no attribute 'get' Chris ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
What version of the SDK are you using?On 20 Apr. 2018 19:28, Chris Friesen wrote: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 "", line 1, in AttributeError: 'Proxy' object has no attribute 'get' Chris ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
On 04/20/2018 01:48 AM, Adrian Turjak wrote: What version of the SDK are you using? Originally I just used what was installed in my devstack VM, which seems to be 0.9.17. Upgrading to 0.12.0 allowed it to work. Thanks, Chris ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
Hi Adrian, at the moment, "wildly different" python clients provide more, than Unified SDK. Not sure about all clients, but what I found and what finally turned me to client libraries is inability to to do actions on stack (e.g. suspend/resume) using Unified SDK (neither doc not source code contain any mentions on this, while python-heatclient describes this and can it to do). It's far from bleeding edge - it's huge gap in feature consistency. On 4/20/18 6:19 AM, Adrian Turjak wrote: As someone who used to use all the standalone clients, I'm leaning very heavily these days to using only the SDK and think we should encourage most projects to treat the SDK as their first point of implementation rather than all the wildly different python clients. So if you are new to OpenStack, the the SDK is the best and most consistent option right now for interacting with OpenStack from python. Sadly though the docs are lacking, but the docs for the other libraries aren't that much better anyway half the time. On 20/04/18 01:46, Chris Friesen wrote: On 04/19/2018 07:01 AM, Jeremy Stanley wrote: On 2018-04-19 12:24:48 +1000 (+1000), Joshua Hesketh wrote: There is also nothing stopping you from using both. For example, you could use the OpenStack SDK for most things but if you hit an edge case where you need something specific you can then import the particular client lib. [...] 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") The direct calls on the proxy object use your current session (auth and scope) against the endpoint specific to that service, and just return the raw request itself when called directly. This works even for Swift where the url has to include details about your account. It's surprisingly elegant. Ideally when people use the SDK like this they should also submit a patch to fill in the missing functionality. Adding to the SDK isn't that bad and the codebase is much better than it used to be. Thanks, Chris ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack -- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Re: [Openstack] which SDK to use?
I don't disagree that the SDK lacks feature parity, which is oddly enough one of the main reasons I'm actually using it, to find those missing features, document them, maybe fix them, or if I can't fix them annoy the right people who can. With the SDK there is at least always a way to get around the lack of feature parity now by using the direct calls to the proxy object. I don't think that's a good solution, but it's a way to start using it and then start contributing back the actual implementations of those features. I've been bitten and annoyed too many times by how different and inconsistent the various other clients are, and while some of them have some great code and features, the fact that they work very differently to the others just drives me mad. Or even in the case of the neutronclient, there is 'neutronclient.client' and 'neutronclient.neutron.client'. The former is the more supported and documented one it seems (although the code terrifies me... it's a 2500 line single file), while the latter appears to be an unfinished client that was meant to be more in line with the other service clients but I think is lacking features and docs. I've never dug enough into that to find out what's going on there. Then we have the odd thing where most of the client list commands return lists of objects, while some (I'm looking at you glance), returns a generator. While I prefer returning lists, the SDK is at least always consistent in that it returns generators for ALL list commands, and ultimately you can always wrap those calls in a list() and it's the same result. And don't get me started on the swiftclient. :P The SDK isn't perfect, but it can and will get better, and it's better than the alternative, which is mostly a weird kind of inconsistent madness. We can't make all those clients work the same, that would break backwards compatibility and it would take too much effort. We can though have a unified consistent SDK that will hopefully in future be the point of first implementation for features rather than their own clients. First, we need to get people using the SDK and seeing the benefit of it, and that takes time, and people helping implement those missing features. On 22/04/18 01:37, Volodymyr Litovka wrote: > Hi Adrian, > > at the moment, "wildly different" python clients provide more, than > Unified SDK. Not sure about all clients, but what I found and what > finally turned me to client libraries is inability to to do actions on > stack (e.g. suspend/resume) using Unified SDK (neither doc not source > code contain any mentions on this, while python-heatclient describes > this and can it to do). It's far from bleeding edge - it's huge gap in > feature consistency. There seems to be a fairly old patch that started adding this but was rejected due to missing tests: https://review.openstack.org/#/c/190551/ I can't find anything more recent, but I didn't look too hard. While not ideal you can call _action directly yourself on a stack object, but it isn't particularly elegant: https://github.com/openstack/openstacksdk/blob/master/openstack/orchestration/v1/stack.py#L90 stack = conn.orchestration.get_stack(stack_id) resp = stack._action(conn.orchestration, {'suspend': ''}) I know that doesn't really help that much, but it's the best I can recommend right now. :( > > On 4/20/18 6:19 AM, Adrian Turjak wrote: >> As someone who used to use all the standalone clients, I'm leaning very >> heavily these days to using only the SDK and think we should encourage >> most projects to treat the SDK as their first point of implementation >> rather than all the wildly different python clients. >> >> So if you are new to OpenStack, the the SDK is the best and most >> consistent option right now for interacting with OpenStack from python. >> Sadly though the docs are lacking, but the docs for the other libraries >> aren't that much better anyway half the time. >> >> >> On 20/04/18 01:46, Chris Friesen wrote: >>> On 04/19/2018 07:01 AM, Jeremy Stanley wrote: On 2018-04-19 12:24:48 +1000 (+1000), Joshua Hesketh wrote: > There is also nothing stopping you from using both. For example, > you could use the OpenStack SDK for most things but if you hit an > edge case where you need something specific you can then import > the particular client lib. [...] 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. >> >> ser
Re: [Openstack] which SDK to use?
Hi Adrian, Then we have the odd thing where most of the client list commands return lists of objects, while some (I'm looking at you glance), returns a generator. After short period of use, I completely agree with this and other your statements re client libraries. Thanks for pointing on ways to do actions on stack using SDK client. I'll think again about Unified SDK - if it's more unified than clients, some annoyings are acceptable :) -- Volodymyr Litovka "Vision without Execution is Hallucination." -- Thomas Edison ___ Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack Post to : openstack@lists.openstack.org Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack