Ask Your Question
0

allowed search_opts for Nova servers

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

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
0

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

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/servers.py

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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 1,317 times

Last updated: Aug 01 '14