Update os_boot.erb

Using the underscore character "_" for the separator can be problematic - if the <%= repo_url %> value contains an underscore .

My example, the repo was named "ubuntu_server" and of course the sed command would work out when hitting the underscore in the url (http://192.168.1.5:8080/svc/repo/ubuntu_server)

I replaced the delimiter with the character that has the octal value 001 - in ASCII it's the SOH character (start of heading) - which is extremely unlikely to appear in the repo name.

I think it is safer to use this.
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>
Validate `create-task`, adding nested object support

In order to handle the `create-task` command several features were added to
the validation language: nested object support, and the ability to define
additional attributes based on patterns when the set are not knowable ahead
of time.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Validate `create-tag` command

This adds validation for the `create-tag` command.  This simply uses the
existing tooling, adding nothing, in a pleasant break.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Validate `delete-tag`, adding boolean attribute support

In order to validate the `delete-tag` we need support for boolean attributes;
since Ruby splits into TrueClass and FalseClass, rather than a unified Boolean
class, we add the `type: :bool` tag to attribute checks, and restructure the
code to handle this additional special case a little better.

Then, implement `delete-tag` validation using this new capability.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Validate `update_tag_rule` command.

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