Revision 3802f3cf

b/man/ganeti.rst
185 185
are denoted via a special symbol (in terse mode) or a string (in
186 186
verbose mode):
187 187

  
188
*, (offline)
188
\*, (offline)
189 189
    The node in question is marked offline, and thus it cannot be
190 190
    queried for data. This result is persistent until the node is
191 191
    de-offlined.
......
224 224
  # gnt-instance modify -H kernel_path=an\\,example instance1
225 225
  # gnt-instance modify -H kernel_path='an\,example' instance1
226 226

  
227
Query filters
228
~~~~~~~~~~~~~
229

  
230
Most commands listing resources (e.g. instances or nodes) support filtering.
231
The filter language is similar to Python expressions with some elements from
232
Perl. The language is not generic. Each condition must consist of a field name
233
and a value (except for boolean checks), a field can not be compared to another
234
field. Keywords are case-sensitive.
235

  
236
Syntax in pseudo-BNF::
237

  
238
  <quoted-string> ::= /* String quoted with single or double quotes,
239
                         backslash for escaping */
240

  
241
  <integer> ::= /* Number in base-10 positional notation */
242

  
243
  <re> ::= /* Regular expression */
244

  
245
  /*
246
    Modifier "i": Case-insensitive matching, see
247
    http://docs.python.org/library/re#re.IGNORECASE
248

  
249
    Modifier "s": Make the "." special character match any character,
250
    including newline, see http://docs.python.org/library/re#re.DOTALL
251
  */
252
  <re-modifiers> ::= /* empty */ | i | s
253

  
254
  <value> ::= <quoted-string> | <integer>
255

  
256
  <condition> ::=
257
    { /* Value comparison */
258
      <field> { == | != } <value>
259

  
260
      /* Collection membership */
261
      | <value> [ not ] in <field>
262

  
263
      /* Regular expressions (recognized delimiters
264
         are "/", "#", "^", and "|"; backslash for escaping)
265
      */
266
      | <field> { =~ | !~ } m/<re>/<re-modifiers>
267

  
268
      /* Boolean */
269
      | <field>
270
    }
271

  
272
  <filter> ::=
273
    { [ not ] <condition> | ( <filter> ) }
274
    [ { and | or } <filter> ]
275

  
276
Operators:
277

  
278
*==*
279
  Equality
280
*!=*
281
  Inequality
282
*=~*
283
  Pattern match using regular expression
284
*!~*
285
  Logically negated from *=~*
286
*in*, *not in*
287
  Collection membership and negation
288

  
289

  
227 290
Common daemon functionality
228 291
---------------------------
229 292

  

Also available in: Unified diff