Remove trailing whitespace from a few files, no functional change
Add tests for /svc/store_metadata and fix removing metadata values
Add a URL for the installers collection

Note that there is already a handler for individual installers

Fixes https://github.com/puppetlabs/razor-server/issues/119
Don't treat IP address for a node special

There's no good reason why we should handle a node's IP address in any
special way; Razor's builtin logic certainly doesn't depend on it.

  * Instead of a dedicated node.ip_address field, store the node's IP address
    in node.metadata["ip"]
  * Remove the /svc/store endpoint that was used just for that
  * make the store_url helper a wrapper for store_metadata_url that is only
    used to update metadata entries (and not remove them)
* db/migrate/007_mv_ip_to_node_metadata.rb: remove debug print
Add `check-migrations` command

This adds a command to the admin tool that will check if the database requires
a migration, or if it is fully up to date.  This helps support the Puppet
module robustly detecting if migrations need to be run -- and, especially, if
we need to restart the application to reflect those changes.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Add security checks to the installer collection

This adds missing security checks to the installer query API.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Track whether a node is installed or not

We now track the installation state of a node: once an installer finishes
and reports that by doing a GET against stage_done_url('finished'), we
remember the name of the policy and the current timestamp in the node. This
information will stick around until a node is bound to another policy.
Add a 'delete_policy' command

The command will remove the policy from any nodes bound to it, but keep the
nodes marked as 'bound' so that they will boot locally.
Add calls to stage_done_url('finished') to installers missing it

Doing this is now crucial in the installation process; without such a call,
the node will never be marked as 'installed' and therefore won't be
protected when its policy is removed.
Rename `installer` to `recipe` across the product

This updates the product to reflect the actual purpose of these entities: they
are really about applying some sort of process to the machine, rather than
being all about installing something.

This helps support the concrete use-cases that folks have asked for with this:

1. We would like to run a secure disk wipe process before we decommission a
   machine, as part of putting it back into the pool -- but only for machines
   that held certain classes of user data.

2. We would like to upgrade the firmware, or configure the hardware RAID
   controller, on a machine, then install an OS on it.

Both of these are best served by running another recipe against the machine at
some point in the life-cycle, not running an "installer" that actually doesn't
install anything.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
* lib/razor/matcher.rb: factor the code for fact and metadata into common method

In the next commit, we will introduce yet another use of the same logic.
Add a 'state' function to the matcher language

This makes it possible to interrogate the 'installed' state of a node from
tag rules, i.e. a tag rule can now check whether the node has something
valuable on it or not.
Rename the 'unbind-node' command to 'reinstall-node'

This matches more closely now what the command actually does
API change: return objects instead of raw arrays

In the places where the API used to return raw arrays (e.g. all the
collections), now return an object where the actual array is in the 'items'
property. This allows us to annotate such collections with additional
properties in the future without breaking API backwards compatibility.

The corresponding change in razor-client is in commit 07ae04a6
* spec/fabricators/fabricator.rb (random_mac, random_asset): downcase result

We normalize these pieces of data in Razor::Data::Node.canonicalize_hw_info
so that they are always lower case in the database. This makes sure that
fabricated objects adhere to that.
Rudimentary search of nodes by hostname and hw_info

It is now possible to search the nodes collection by these criteria; the
value of the hostname parameter can be a regular expression, the hw_info
attributes are searched with an exact match.

Some examples:

  /api/collections/nodes?hostname=host.*
      find hosts whose name starts with 'host'

  /api/collections/nodes?mac=00:de:ad:be:ef:00
                        ?asset=ABCDE
                        ?uuid=UUUU...UUUU
      find a node whose mac/asset tag/uuid is exactly the given value
Add a modify-policy-max-count command to change a policy's max-count
Add nodes and policies subcollections to tags

This makes it possible to find all nodes tagged with a certain tag, and all
policies in which a tag is used
Add a nodes subcollection to policies

This makes it possible to find all nodes that use a certain policy