Adding GET API to backup

Get backup by ID.

Change-Id: I0a6422ab12449212d144d9fdec1a4c7b282bed85
BP: blueprints.launchpad.net/reddwarf/+spec/consistent-snapshots">https://blueprints.launchpad.net/reddwarf/+spec/consistent-snapshots
This commit is contained in:
Steve Leon
2013-04-29 14:12:57 -07:00
parent 0f4c1f7ba3
commit 0f2391b901
2 changed files with 14 additions and 0 deletions

View File

@@ -32,6 +32,15 @@ class Backups(base.ManagerWithFind):
resource_class = Backup
def get(self, backup):
"""
Get a specific backup.
:rtype: :class:`Backups`
"""
return self._get("/backups/%s" % base.getid(backup),
"backup")
def list(self, limit=None, marker=None):
"""
Get a list of all backups.

View File

@@ -255,6 +255,11 @@ class BackupsCommands(common.AuthedCommandsBase):
"""Command to manage and show backups"""
params = ['name', 'instance', 'description']
def get(self):
"""Get details for the specified backup"""
self._require('id')
self._pretty_print(self.dbaas.backups.get, self.id)
def list(self):
"""List backups"""
self._pretty_list(self.dbaas.backups.list)