From 01eb6409b836c3d70fd2f7cc8e441f9a5f183c75 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Fri, 23 Mar 2012 15:59:06 +0100 Subject: [PATCH] ganeti.7: Add more filter examples Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- man/ganeti.rst | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/man/ganeti.rst b/man/ganeti.rst index e4ff8516d..a87f626f6 100644 --- a/man/ganeti.rst +++ b/man/ganeti.rst @@ -305,6 +305,30 @@ Perl. The language is not generic. Each condition must consist of a field name and a value (except for boolean checks), a field can not be compared to another field. Keywords are case-sensitive. +Examples (see below for syntax details): + +- List webservers:: + + gnt-instance list --filter 'name =* "web*.example.com"' + +- List instances with three or six virtual CPUs and whose primary + nodes reside in groups starting with the string "rack":: + + gnt-instance list --filter + '(be/vcpus == 3 or be/vcpus == 6) and pnode.group =~ m/^rack/' + +- Nodes hosting primary instances:: + + gnt-node list --filter 'pinst_cnt != 0' + +- Nodes which aren't master candidates:: + + gnt-node list --filter 'not master_candidate' + +- Short version for globbing patterns:: + + gnt-instance list '*.site1' '*.site2' + Syntax in pseudo-BNF:: <quoted-string> ::= /* String quoted with single or double quotes, @@ -365,9 +389,6 @@ Operators: *in*, *not in* Collection membership and negation -As a shortcut globbing patterns can be specified as names, e.g. -``gnt-instance list '*.site1' '*.site2'``. - Common daemon functionality --------------------------- -- GitLab