Fix self.fields on API Node object

All fields from objects.Node were being added to self.fields in
the API Node object. Because of this, when someone would POST, there'd
be an entry for {'id': None} in the dictionary passed to
dbapi.create_node(). We should only set fields we're exposing.

This also required fixing PATCH to not try to look at fields not set
on the API Node object when mapping to objects.Node.

A later patchset removes the direct dbapi call to create_node() in
flavor of using the objects.Node object where trying to set 'id' of None
would fail prior to this fix.

Change-Id: I92c03d9ff2a56e7999a685f9de38efec5aacbe47
Sync base object code with Nova's

This brings Ironic's base object code more in line with nova's since the
time it was copied. There's still a large difference in the field/type
declarations that we should resolve at some point. (Would be helpful if
this was in oslo, maybe. :)

A couple of these changes are needed for my future patchsets for object
cleanup.

Change-Id: I7e233fb448e9ce56f707d230dc5b2558bdb0a1f9
Fix seamicro power.validate() method definition

* Add task param to the power.validate method definition
* Also add unit tests for the power.validate method

This was not caught when unit testing Ironic using python-seamicroclient
because there is no unit test cover for this method.

Change-Id: I9ed175cffa29b8c10a32c7e121525142e4b170a5
Closes-Bug: #1303670
JsonPatch add operation on existing property

Before a validation code in Ironic was preventing any 'add' operation
to the root of the document, but this create an inconsistency with
multi-level attributes (e.g extra) where 'add' operations works
interchangeable if used on existing properties, this behavior is expect
as per RFC 6902. So this patch makes it possible to use 'add' operations
to replace the values of the properties at the root of the document.

It's important to note that as per Ironic design we do not allow to add
new properties to the root of the document.

Change-Id: Ie448ec46273d7a849c135940084d72d66b9b8a53
Closes-Bug: #1278441
Merge "Fix self.fields on API Node object"
Merge "Sync base object code with Nova's"
Merge "Fix seamicro power.validate() method definition"