{
reqd=["edition"];
optn=["host-uuid"; "license-server-address"; "license-server-port"];
- help="Change to another edition, or reactivate the current edition after a license has expired. This may be subject to the successful checkout of an appropriate license";
+ help="Change to another edition, or reactivate the current edition after a license has expired. This may be subject to the successful checkout of an appropriate license.";
implementation=No_fd Cli_operations.host_apply_edition;
flags=[];
};
+ "host-all-editions",
+ {
+ reqd=[];
+ optn=[];
+ help="Get a list of all available editions.";
+ implementation=No_fd Cli_operations.host_all_editions;
+ flags=[];
+ };
"host-evacuate",
{
reqd=["uuid"];
raise e
| e -> raise e
+let host_all_editions printer rpc session_id params =
+ let editions = List.map (fun (e, _, _, _) -> e) (V6client.get_editions ()) in
+ printer (Cli_printer.PList editions)
+
let host_evacuate printer rpc session_id params =
let uuid = List.assoc "uuid" params in
let host = Client.Host.get_by_uuid rpc session_id uuid in
case "${COMP_WORDS[1]}" in
diagnostic-vm-status) cmd=vm-list;;
diagnostic-vdi-status) cmd=vdi-list;;
- *) cmd=`echo ${COMP_WORDS[1]} | awk -F- '/^host-cpu-/ || /^host-crashdump-/ { print $1 "-" $2 }\r$0 !~ /^host-cpu-/ && $0 !~ /^host-crashdump-/ { print $1 }'`-list;;
+ *) cmd=`echo ${COMP_WORDS[1]} | awk -F- '/^host-cpu-/ || /^host-crashdump-/ { print $1 "-" $2 }
+$0 !~ /^host-cpu-/ && $0 !~ /^host-crashdump-/ { print $1 }'`-list;;
esac
IFS=$'\n,'
COMPREPLY=( $(compgen_names "$cmd" uuid "$value") )
COMPREPLY=( $(compgen -W "vm-power-admin,vm-admin,vm-operator,read-only,pool-operator,pool-admin" -- ${LAST_VALUE}) )
return 0
;;
- edition) # for host-apply-edition (licensing)
- IFS=$'\n,'
- COMPREPLY=( $(compgen -W "free ,enterprise ,platinum ,enterprise-xd " -- ${value}) )
- return 0
- ;;
+ edition) # for host-apply-edition (licensing)
+ IFS=$'\n,'
+ LAST_VALUE=`echo ${value}|gawk 'BEGIN{FS=" "}{print $NF}'`
+ EDITIONS=`${xe} host-all-editions --minimal 2>/dev/null`
+ COMPREPLY=( $(compgen -W "${EDITIONS}" -- ${LAST_VALUE}) )
+ return 0
+ ;;
*)
snd=`echo ${param} | cut -d- -f2`
fst=`echo ${param} | cut -d- -f1`