WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 21 of 21] CP-1880: cli autocompletion for vmpp fields

To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH 21 of 21] CP-1880: cli autocompletion for vmpp fields
From: Marcus Granado <marcus.granado@xxxxxxxxxx>
Date: Fri, 20 Aug 2010 17:52:40 +0100
Delivery-date: Fri, 20 Aug 2010 10:40:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1282323139@localhost>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1282323139@localhost>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.4.3
 ocaml/xe-cli/bash-completion |  52 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)


# HG changeset patch
# User Marcus Granado <marcus.granado@xxxxxxxxxx>
# Date 1282322886 -3600
# Node ID caf52c056c51ff6c982539f8eb5008dc9610991e
# Parent  f1dfeac7040f67699d4966cd48b9220d64030281
CP-1880: cli autocompletion for vmpp fields

Signed-off-by: Marcus Granado <marcus.granado@xxxxxxxxxxxxx>

diff -r f1dfeac7040f -r caf52c056c51 ocaml/xe-cli/bash-completion
--- a/ocaml/xe-cli/bash-completion
+++ b/ocaml/xe-cli/bash-completion
@@ -168,6 +168,38 @@
                 COMPREPLY=`${xe} host-list params=uuid --minimal 2>/dev/null`
                 return 0
                 ;;
+                       backup-type) # for vmpp
+                                IFS=$'\n,'
+                               COMPREPLY=( $(compgen -W "snapshot,checkpoint" 
-- ${value}) )
+                               return 0
+                               ;;
+                        backup-frequency) # for vmpp
+                                IFS=$'\n,'
+                                COMPREPLY=( $(compgen -W "hourly,daily,weekly" 
-- ${value}) )
+                                return 0
+                                ;;
+                        archive-frequency) # for vmpp
+                                IFS=$'\n,'
+                                COMPREPLY=( $(compgen -W 
"never,always_after_backup,daily,weekly" -- ${value}) )
+                                return 0
+                                ;;
+                        archive-target-type) # for vmpp
+                                IFS=$'\n,'
+                                COMPREPLY=( $(compgen -W "none,cifs,nfs" -- 
${value}) )
+                                return 0
+                                ;;
+                       backup-schedule:days) # for vmpp 
+                                IFS=$'\n,'
+                               LAST_VALUE=`echo ${value}|gawk 'BEGIN{FS=" 
"}{print $NF}'`
+                                COMPREPLY=( $(compgen -W 
"monday,tuesday,wednesday,thursday,friday,saturday,sunday" -- ${LAST_VALUE}) )
+                                return 0
+                                ;;
+                        archive-schedule:days) # for vmpp
+                                IFS=$'\n,'
+                               LAST_VALUE=`echo ${value}|gawk 'BEGIN{FS=" 
"}{print $NF}'`
+                                COMPREPLY=( $(compgen -W 
"monday,tuesday,wednesday,thursday,friday,saturday,sunday " -- ${LAST_VALUE}) )
+                                return 0
+                                ;;
             edition) # for host-apply-edition (licensing)
                 IFS=$'\n,'
                 COMPREPLY=( $(compgen -W "free ,advanced ,enterprise ,platinum 
,enterprise-xd " -- ${value}) )
@@ -205,6 +237,10 @@
                hostselectors=`${xe} help ${COMP_WORDS[1]} 2>/dev/null | grep 
"optional params" | grep "<host-selectors>"`
                isdeviceconfig=`echo "${param}" | grep "device-config:"`
                isvcpusparams=`echo "${param}" | grep "VCPUs-params:"`
+               isvmppbackupschedule=`echo "${param}" | grep "backup-schedule:"`
+               isvmpparchiveschedule=`echo "${param}" | grep 
"archive-schedule:"`
+               isvmpparchivetargetconfig=`echo "${param}" | grep 
"archive-target-config:"`
+               isvmppalarmconfig=`echo "${param}" | grep "alarm-config:"`
                if [ "${isdeviceconfig}" ]; then
                        IFS=" " type=$(for i in ${COMP_WORDS[@]:2}; do echo $i 
| grep "^type="; done | sed -e 's/^type=//' | tr [A-Z] [a-z])
                        extraargs=,$(IFS=";"; for i in `xe sm-list type=${type} 
params=configuration --minimal 2>/dev/null`; do echo device-config:$i | cut -d 
':' -f 1-2; done | sed -e 's/ //g' -e 's/$/=/')
@@ -222,6 +258,22 @@
                   else
                      extraargs=",host="
                   fi
+               elif [ "${isvmppbackupschedule}" ]; then
+                  pfx=`echo ${isvmppbackupschedule} | cut -d ':' -f 1`
+                  COMPREPLY=( $(compgen -W 
"${pfx}:min=,${pfx}:hour=,${pfx}:days=" -- ${param}) )
+                   return 0
+                elif [ "${isvmpparchiveschedule}" ]; then
+                  pfx=`echo ${isvmpparchiveschedule} | cut -d ':' -f 1`
+                   COMPREPLY=( $(compgen -W 
"${pfx}:min=,${pfx}:hour=,${pfx}:days=" -- ${param}) )
+                   return 0
+                elif [ "${isvmpparchivetargetconfig}" ]; then
+                  pfx=`echo ${isvmpparchivetargetconfig} | cut -d ':' -f 1`
+                   COMPREPLY=( $(compgen -W 
"${pfx}:location=,${pfx}:username=,${pfx}:password=" -- ${param}) )
+                   return 0
+                elif [ "${isvmppalarmconfig}" ]; then
+                  pfx=`echo ${isvmppalarmconfig} | cut -d ':' -f 1`
+                   COMPREPLY=( $(compgen -W 
"${pfx}:smtp_server=,${pfx}:smtp_port=,${pfx}:email_address=" -- ${param}) )
+                   return 0
                else
                   extraargs=""
                fi

Attachment: xen-api.hg-21.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>