Cisco Cisco Prime Home 6.3 Developer's Guide

Page of 78
Cisco Prime Home – Integration Guide
 
 
OL-28558-01   v5.1
 
78 
Appendix A:  CAQL BNF 
BNF 
 
<caql>             ::= <doc-clause> <terms> <show-clause> <sort-clause> 
                     | <doc-type> <show-clause> <sort-clause> 
  
<doc-clause>       ::= <doc-type> "with" 
                     | "" <!-- <doc-clause> is optional --> 
  
<terms>            ::= <term> 
                     | <term> <terms> <!-- one or more with implied AND logic --> 
                     | <term> and <terms> <!-- one or more with explicit AND logic --> 
                     | <term> or <terms> <!-- one or more with OR logic --> 
  
<term>             ::= <all-field-value> 
                     | <field-name> ":" <field-value> 
                     | <field-name> ":" "in" "(" <literal-list> ")" 
  
<field-value>      ::= <literal> 
                     | <range> 
  
<all-field-value>  ::= <text> 
                     | <octet> "." <octet> "." <octet> "." <octet> <!-- IP address --> 
                     | <range> 
  
<literal>          ::= <text> 
                     | <number> 
                     | <mm> "/" <dd> "/" <yyyy> <!-- date --> 
                     | <octet> "." <octet> "." <octet> "." <octet> <!-- IP address --> 
  
<literal-list>     ::= <literal> 
                     | <literal> <literal-list> <!-- one or more --> 
  
<range>            ::= "from" <literal> "to" <literal> 
                     | "from" <literal> 
                     | "to" <literal> 
  
<show-clause>      ::= "show" <show-terms> 
                     | "" <!-- <show-clause> is optional --> 
  
<show-terms>       ::= <show-term> 
                     | <show-term> <show-terms> <!-- one or more --> 
  
<show-term>        ::= <field-name> 
                     | <field-name> as <field-alias> <!-- optional alias --> 
  
<sort-clause>      ::= "sort" <sort-terms> 
                     | "" <!-- <sort-clause> is optional --> 
  
<sort-terms>       ::= <sort-term> 
                     | <sort-term> <sort-terms> <!-- one or more --> 
  
<sort-term>        ::= <field-name> 
                     | <field-name> <sort-direction> 
  
<sort-direction>   ::= "asc" 
                     | "desc"