Ask Your Question

allowed search_opts for Nova servers

asked 2014-08-01 07:38:38 -0500

blairo gravatar image

I'm attempting to write a script against the Python novaclient library - I want to get a list of servers that have a particular metadata key across the whole cloud or within just a specific cell/zone. I notice the servers list method "list(detailed=True, search_opts=None, marker=None, limit=None)" takes a search_opts dict, which e.g., I need to use to set all_tenants, but I've no idea what options are actually supported. There doesn't seem to be any documentation for this and grepping through the Nova code doesn't even turn up any obvious logic handling all such options in the API. So, is there a definition somewhere?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-08-01 07:46:05 -0500

blairo gravatar image

Ah, so now I'm gonna be one of those obnoxious folks who answers their own question...

Found this:

 def _get_server_search_options(self):
     """Return server search options allowed by non-admin."""
     return ('reservation_id', 'name', 'status', 'image', 'flavor',
             'ip', 'changes-since', 'all_tenants')

in nova/nova/api/openstack/compute/

(Needed to grep for "search_options" rather than "search_opts")

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-08-01 07:38:38 -0500

Seen: 1,418 times

Last updated: Aug 01 '14