Recommendation for sorting (e.g. by application name)
coobr01 opened this issue · 2 comments
coobr01 commented
Based on the way the objects are created from the REST API, is there a recommended way to sort the contents of certain objects? For example, what is the best way to print all applications across all spaces alphabetically?
Thanks!
antechrestos commented
Hi
I would say it is an algorithmic issue as there is nothing in the api.
I would do something like this to collect all applications (you should take care of handling application with same name in different space)
applications = dict()
for organization in client.v2.organizations:
for space in organization.spaces():
for app in space.apps():
applications[app['entity']['name']] = app # maybe the name is used in another space and will be overwritten
Then after googling there are solutions like this one
coobr01 commented
Thanks for clarifying the scope of the library, keep up the great work!