Move reports to "experimental" namespace

This commit does the following:

* Moves all report http/query stuff out of v2 and into "experimental"
* Adds the word "experimental" to the log message for the report
  report submission command.

I decided not to rename the actual command or the report processor
for now, so that those will be forward-compatible for users that
may adopt them early.
Refactor arg list and remove (declare ...)
Replace /status/nodes/<node> with /status/<node>

There are no other types of objects that are queryable from the status
API, so the intermediary path component isn't needed. This change also
makes it easier for other routes to forward requests to the status app,
as they don't need to worry about rewriting the URL.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Friendlier REST endpoints for PuppetDB querying

This changeset exposes the following new endpoints:

* /nodes/<node> returns status information for the given node

* /nodes/<node>/facts returns all the facts for that node

* /nodes/<node>/facts/<fact> returns the specific fact for the indicated
  node

* /nodes/<node>/resources returns all the resources for the given node

* /nodes/<node>/resources/<type> returns all the resources for the given
  node with the supplied type

* /nodes/<node>/resources/<type>/<title> returns all the resources for
  the given node with the supplied type and title.

* /facts/<fact> returns all facts with that name, across the population

* /resources/<type> returns all resources of that type, across the
  population

* /resources/<type>/<title> returns all resources of that type and
  title, across the population

So you can now do things like hit /resources/User/deepak to get the
details of a specific User object, or things like /facts/kernel to get a
fact across the whole population in one-shot.

Each of these endpoints also allows for an additional "query" parameter,
obeying the same query format we've always suppported. The only
difference is that if you do, say:

    /nodes/foo.com/resources?query=...

then the query will only operate on resources for the given node.

This is all currently anchored under /experimental, pending integration
into the existing v2 endpoints.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
The "puppet node status" face should use new /status API

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Remove unused var in status route

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Move new HTTP endpoints from /experimental into /v2

This patchset fully integrates the new exploration-oriented endpoints
under the /v2 routes.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Update the facts terminus to use /v2/nodes/:node/facts

The facts endpoint has changed to no longer provide node-specific facts
based solely on URL path components. However, we can route that request
to the new `/v2/nodes/:node/facts` URL instead.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
"node status" face should use versioned HTTP endpoint

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #361 from cprice-puppet/maint/master/move-reports-to-experimental

Move reports to "experimental" namespace
Acceptance: fix URLs for experimental reports endpoints
Move node query into centralized query.clj

This removes duplication of the and/or/not implementations and paves the
way for adding subquery support for nodes.
(#17356) Queries should involve only active nodes

Previously, queries had to specify that they wanted to exclude
deactivated nodes. Unfortunately, it turned out that there are basically
zero use cases for wanting to query resources or facts of deactivated
nodes, and the overwhelmingly common use cases required an extra clause
to ensure that inactive nodes were excluded.

It's much nicer to just fiat that resource and fact queries only ever
touch active nodes. Common queries are now much shorter, and we
eliminate a source of user confusion.

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #362 from nicklewis/standardize-node-query

There is nothing in here that I think is worth blocking this getting in and getting tested, but it would be good to go back and add docs/pres in a few places.
Update docs/tests/funcs based on review comments

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #360 from grimradical/rest-exploration

Friendlier HTTP endpoints for querying