ppdb.1 in hieracles-0.2.2 vs ppdb.1 in hieracles-0.3.0

- old
+ new

@@ -2,11 +2,10 @@ .SH NAME ppdb \- Command line tool to query puppetdb .SH SYNOPSIS .B ppdb -.I object .I command .B [ .I options .B ] @@ -27,21 +26,15 @@ of the PuppetDB API. .PP Ref http://docs.puppetlabs.com/puppetdb/2.3/api/ .PP .B ppdb -takes at minimum 2 arguments, an object (or endpoint) -and a subcommand, plus extra parameters depending the subcommand. -.PP -The object is like the endpoint in PuppetDB API, but we extend it -to a different list of possible objects: +takes a command, plus extra parameters depending the command. -.IP node 10 -Uses the nodes endpoint. It accepts the subcommands: -.RS - -.IP info 10 +.TP +.PD 0 +.B node info \fR<fqdn> will display the equivalent of .I "GET /v3/nodes/<NODE>" and takes the node .B certname as an argument. @@ -58,11 +51,13 @@ .I time in their label. .RE .RE -.IP facts 10 +.TP +.PD 0 +.B node facts \fR<fqdn> will display the equivalent of .I "GET /v3/nodes/<NODE>/facts" and takes the node .B certname as an argument. @@ -80,11 +75,13 @@ .I memory in their label. .RE .RE -.IP resources 10 +.TP +.PD 0 +.B node resources \fR<fqdn> will display the equivalent of .I "GET /v3/nodes/<NODE>/resources" and takes the node .B certname as an argument. You can use @@ -106,18 +103,86 @@ .I nagios in their label. .RE .RE +.RE + +.TP +.PD 0 +.B facts <name> <value> +will list all fqdn (aka. certnames) of the nodes having the <name> +fact set to <value>. +.RS +eq. ppdb facts puppet_environment dev +.RE + +.TP +.PD 0 +.B same <name> <fqdn> +will list all the fqdn having the same value for the fact <name> as +<fqdn> has. +.RS +eq. ppdb same farm node32.example.com +.RE + +.TP +.PD 0 +.B resources <queries> +.TP +.PD +.B res <queries> +will list the resources matching a given set of queries. +Queries are a combination of statements, with a label, an operator +and a value. You can use +.I or +to separate one or several statements. If there is no +.I or +indicated, the statements follow an +.I and +logic. All statements that don't contain an operator or match the +.I or +keyword are purely ignored (which makes possible to use the +.I and +keyword for mental stability purpose). + +.RS +Operators can be >, <, =, ~ and can be prefixed by a ! to negate them. +.RS +eq. ppdb res type=Nagios_ghost and tag~api +.RE +.RS +eq. ppdb res tag~api title!~dev +.RE +.RS +eq. ppdb res tag~api or certname~api or title~api +.RE +.RE + +.TP +.PD 0 +.B factnames +will list all the factnames puppetdb knows about. +This may be a long list. + .SH OPTIONS .TP .PD 0 .B \-v .TP .PD .B \-\-version outputs version. + +.TP +.PD 0 +.B \-f \fRformat +.TP +.PD +.B \-\-format \fRformat +outputs in the selected format. For now only the json format +is available as an alternative to the default console format. .SH FILES .I ~/.config/hieracles/config.yaml .RS