Split metrics/version/command out of api.clj and into their own
namespaces
(PDB-238) - Remove v1 API

This commit removes the v1 API and builds on the HTTP api refactor.
This commit contains:

- Remove all v1 namespaces and the namespaces calling them
- Remove api tests excercising the v1 routes
- Remove v1 references in the docs
PDB-437 Reduce API source code and version inconsistencies

The API code when split between different versions created an opportunity for
inconsistencies to grow. For example, some versioning inside the code supported
this file based way of abstracting versions, but other functions required
version specific handling.

The problem was that the version wasn't always filtered down properly due to a
lack of a structured way of handling versions.

Not only that, whenever a new version of the API is cut the amount of code that
is simply copied and pasted was quite large.

This patch collapses any version specific code into a single unit. For example
the end-points v2/facts and v3/facts can now be handled by the same application.

The way this is achieved is by passing a keyword of the version: :v1, :v2, :v3
from the top level ring app and pass that into any functions that require
'versioned' capabilities. This version can then be used in decision code (ie.
like a case statement) to execute differently dependant on version.

Because the version pattern is consistent, we should be able to ensure that
particular versioned behaviour is also called consistently no matter where in
the stack a function is executed. This should reduce cases like we've seen
before where v3 api end-points still exhibit v2 behavours on very specific
experessions.

For the query parts of the code, we've applied the same versioned pattern.
The tests now iterate across all supported versions for each tests as well
providing more coverage generally.

Signed-off-by: Ken Barber <ken@bob.sh>
Fixed an anonymizer test hidden behind a lazy seq

Since coll? doesn't force the seq, essentially the function
under test wasn't being ran. The test had a vector where
a map was expected which fails when the seq is forced.
PDB-437 Clojure lint cleanups

Remove some circular dependencies from copy & pasting and remove more cases
of unlimited 'use'.

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-234 Cleanup some minor code duplication and missing versions from case

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #844 from senior/maint/1.6.x/anonymizer-lazy-test-fix

Fixed an anonymizer test hidden behind a lazy seq
Merge pull request #840 from senior/ticket/master/pdb-238-remove-v1

(PDB-238) Remove v1 API
Merge branch '1.6.x'

* 1.6.x:
  Fixed an anonymizer test hidden behind a lazy seq
Merge pull request #843 from kbarber/ticket/1.6.x/PDB-437-reduce-http-code

PDB-437 Reduce API source code and version inconsistencies
PDB-177 Replace ssl-host default with 0.0.0.0

By trying to use a hostname, the amount of issues people suffer with during
setup times related to hostname resolution is quite high. This patch
replaces the hostname with 0.0.0.0 which by default listens on all
interfaces.

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-177 Remove superflous fqdn lookups

Now that the ssl-host no longer needs a hostname, we can remove this code
that looks up the fqdn.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge branch '1.6.x' into maint/master/api-cleanup-rollup-from-16x

This commit includes some hand modified changes to remove more :v1 deprecations
since this that original patch was merged. Downstream changes in 1.6.x had
basically added more :v1 knowledge, but the manual changes as a part of this
merge have removed those references and will now throw exceptions for any :v1
version reference.

* 1.6.x:
  PDB-234 Cleanup some minor code duplication and missing versions from case
  PDB-437 Clojure lint cleanups
  PDB-437 Reduce API source code and version inconsistencies

Conflicts:
	src/com/puppetlabs/puppetdb/http/v1/node.clj
	src/com/puppetlabs/puppetdb/http/v1/resources.clj
	src/com/puppetlabs/puppetdb/http/v1/status.clj
	src/com/puppetlabs/puppetdb/http/v2.clj
	src/com/puppetlabs/puppetdb/query.clj
	src/com/puppetlabs/puppetdb/query/facts.clj
	src/com/puppetlabs/puppetdb/query/nodes.clj
	src/com/puppetlabs/puppetdb/query/resources.clj
	test/com/puppetlabs/puppetdb/test/query/resources.clj
Merge pull request #846 from kbarber/maint/master/api-cleanup-rollup-from-16x

Maint/master/api cleanup rollup from 16x
Change tutorial examples to use v3 API

All the tutorial examples still use the v2 API. This patch converts them to v3
examples instead.

Signed-off-by: Ken Barber <ken@bob.sh>
Switch curl examples to v3 also

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #847 from kbarber/maint/1.5.x/switch-tutorial-to-use-v3-api

Change tutorial examples to use v3 API
Merge branch '1.5.x' into 1.6.x

* 1.5.x:
  Switch curl examples to v3 also
  Change tutorial examples to use v3 API
Merge branch '1.6.x'

* 1.6.x:
  Switch curl examples to v3 also
  Change tutorial examples to use v3 API

Conflicts:
	documentation/api/query/tutorial.markdown
Merge pull request #845 from kbarber/ticket/master/PDB-177-ssl-host-meaningful-default

PDB-177 Replace ssl-host default with 0.0.0.0