From 29cbceab3401c106e6619da58f7609fb569899df Mon Sep 17 00:00:00 2001 From: John Eckersberg Date: Mon, 28 Jan 2008 16:01:10 -0500 Subject: initial snap module --- func/minion/modules/netapp/snap.py | 57 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 func/minion/modules/netapp/snap.py diff --git a/func/minion/modules/netapp/snap.py b/func/minion/modules/netapp/snap.py new file mode 100644 index 0000000..be27b68 --- /dev/null +++ b/func/minion/modules/netapp/snap.py @@ -0,0 +1,57 @@ +## +## NetApp Filer 'snap' Module +## +## Copyright 2007, Red Hat, Inc +## John Eckersberg +## +## This software may be freely redistributed under the terms of the GNU +## general public license. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, write to the Free Software +## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +## + +import re +from func.minion.modules import func_module +from func.minion.modules.netapp.common import * + +class Snap(func_module.FuncModule): + + # Update these if need be. + version = "0.0.1" + api_version = "0.0.1" + description = "Interface to the 'snap' command" + + def create(self, filer, args): + """ + TODO: Document me ... + """ + regex = """creating snapshot...""" + param_check(args, ['volname', 'snapname']) + + cmd_opts = ['snap', 'create'] + cmd_opts.extend([args['volname'], args['snapname']]) + + output = ssh(filer, cmd_opts) + return check_output(regex, output) + + def delete(self, filer, args): + """ + TODO: Document me ... + """ + regex = """deleting snapshot...""" + param_check(args, ['volname', 'snapname']) + + cmd_opts = ['snap', 'delete'] + cmd_opts.extend([args['volname'], args['snapname']]) + + output = ssh(filer, cmd_opts) + return check_output(regex, output) + + def list(self, filer, args): + """ + TODO: Document me ... + """ + return True + -- cgit