reservation_id optional parameter added to GET /servers (aka 'list')
This commit is contained in:
parent
7090a6c8e0
commit
e4d75757c6
@ -47,7 +47,7 @@ copyright = u'Rackspace, based on work by Jacob Kaplan-Moss'
|
||||
# The short X.Y version.
|
||||
version = '2.4'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '2.4.3'
|
||||
release = '2.4.4'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
@ -2,6 +2,16 @@
|
||||
Release notes
|
||||
=============
|
||||
|
||||
2.5.0 (June 2, 2011) - soon
|
||||
=================
|
||||
|
||||
* better logging
|
||||
|
||||
2.4.4 (June 1, 2011)
|
||||
=================
|
||||
|
||||
* added support for GET /servers with reservation_id (and /servers/detail)
|
||||
|
||||
2.4.3 (May 27, 2011)
|
||||
=================
|
||||
|
||||
|
@ -187,12 +187,18 @@ class ServerManager(base.BootingManagerWithFind):
|
||||
"""
|
||||
return self._get("/servers/%s" % base.getid(server), "server")
|
||||
|
||||
def list(self):
|
||||
def list(self, reservation_id=None):
|
||||
"""
|
||||
Get a list of servers.
|
||||
Optional reservation_id only returns instances with that
|
||||
reservation_id.
|
||||
|
||||
:rtype: list of :class:`Server`
|
||||
"""
|
||||
return self._list("/servers/detail", "servers")
|
||||
reservation = ""
|
||||
if reservation_id:
|
||||
reservation = "?reservation_id=%s" % reservation_id
|
||||
return self._list("/servers/detail%s" % reservation, "servers")
|
||||
|
||||
def create(self, name, image, flavor, ipgroup=None, meta=None, files=None,
|
||||
zone_blob=None, reservation_id=None):
|
||||
|
@ -460,10 +460,16 @@ class OpenStackShell(object):
|
||||
"""Delete an IP group."""
|
||||
self._find_ipgroup(args.group).delete()
|
||||
|
||||
@arg('--reservation_id',
|
||||
dest='reservation_id',
|
||||
metavar='<reservation_id>',
|
||||
default=None,
|
||||
help='Only return instances that match reservation_id.')
|
||||
def do_list(self, args):
|
||||
"""List active servers."""
|
||||
print_list(self.cs.servers.list(), ['ID', 'Name', 'Status',
|
||||
'Public IP', 'Private IP'])
|
||||
reservation_id = args.reservation_id
|
||||
print_list(self.cs.servers.list(reservation_id=reservation_id),
|
||||
['ID', 'Name', 'Status', 'Public IP', 'Private IP'])
|
||||
|
||||
@arg('--hard',
|
||||
dest='reboot_type',
|
||||
|
2
setup.py
2
setup.py
@ -11,7 +11,7 @@ if sys.version_info < (2,6):
|
||||
|
||||
setup(
|
||||
name = "python-novaclient",
|
||||
version = "2.4.3",
|
||||
version = "2.4.4",
|
||||
description = "Client library for OpenStack Nova API",
|
||||
long_description = read('README.rst'),
|
||||
url = 'https://github.com/rackspace/python-novaclient',
|
||||
|
Loading…
x
Reference in New Issue
Block a user