Updated api.md with node collection query

The node collection (/api/collections/nodes) supports queries against
hostnames and hw_info attributes. Added documentation of this including an
example.
* README.md: fix typo
* NEWS.md: fix typos
* README.md: changed "recipes" reference to "tasks
Prevent duplicate tempfiles when streaming download

Per RAZOR-73: When downloading a file for a repo, the code would create two temporary files: one from open-uri and one the code created explicitly. This now moves open-uri's tempfile in an attempt to avoid creating a duplicate.
Make `json_name_from_ruby` available in Object

We regularly need to present the user with a name for something they
submitted, for type checking and so forth.  Since this is so common, and
happens in so many places, it seems reasonable to have a single central method
to expose this translation capability to the world.

By design this should take everything -- classes, and instances -- and return
the correct string for the user.  Returned strings are not translated, since
these are technical terms, not internal jargon.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Initial command validation DSL and implementation

This adds a DSL for command validation, along with an implementation covering
the most basic validation needs.  This is obviously incomplete, but serves to
replace a number of current command validations.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Realize node name in the database

We previously had a fairly universal concept of a node "name" through the
code, but it was only constructed in the application logic, not in
the database.

This means that various database level operations were simply impossible when
using the name, and that a complex set of deconstructions had to be used
through the codebase to deal with this.

Now, we simply have the column in the database, and use it.  This fixes that
non-uniform API, a win alone, but also paves the way for a future when users
can assign more meaningful names to nodes without violating the expectations
of the overall system.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Use object reference validation for node reinstall commands

This moves to using the validation DSL to pre-check the node is a valid
reference when we issue a node-reinstall command.  That avoids the need to
handle it in the code specifically.

This also changes the return code from 202 to 404 if you issue the command
against a node that does not exist, which seems reasonable as that is
ultimately a user intent failure: we can't do what they wanted, and they
presumably expected *something* to be reinstalled when they issued
the command.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Add validation for the IPMI credential command

This adds validation, along with the additional validation feature that some
attributes may cause others to be required, but only if they are present.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Validate more commands, and add "value in set" operation

In order to validate the "set desired power state" value for a node, we need
to restrict the value to a small subset of legal values.  This implements that
check in the validator, and then applies that to the problem at hand.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>