From 0f2391b901a2f0abc792ccb5fd527c4911a57e13 Mon Sep 17 00:00:00 2001 From: Steve Leon Date: Mon, 29 Apr 2013 14:12:57 -0700 Subject: [PATCH] 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 --- reddwarfclient/backups.py | 9 +++++++++ reddwarfclient/cli.py | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/reddwarfclient/backups.py b/reddwarfclient/backups.py index 897f0932..c78b8408 100644 --- a/reddwarfclient/backups.py +++ b/reddwarfclient/backups.py @@ -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. diff --git a/reddwarfclient/cli.py b/reddwarfclient/cli.py index 3b71396b..a836b069 100644 --- a/reddwarfclient/cli.py +++ b/reddwarfclient/cli.py @@ -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)