Fix new schema to match the new server definitions

A new server version now validates the state definitions in
traits as well as commands and some of our sample traits were
not defined properly. Also, the server now requires the 'base'
trait to be complete (and have base.reboot and base.identify
commands defined).

Change-Id: Icc576918895eba642498aa9b8bb1771825562f06
Reviewed-on: https://weave-review.googlesource.com/1971
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/base_api_handler.cc b/src/base_api_handler.cc
index 9c64463..5562b6c 100644
--- a/src/base_api_handler.cc
+++ b/src/base_api_handler.cc
@@ -13,7 +13,7 @@
 namespace weave {
 
 namespace {
-const char kBaseComponent[] = "weave";
+const char kBaseComponent[] = "base";
 const char kBaseTrait[] = "base";
 const char kBaseStateFirmwareVersion[] = "base.firmwareVersion";
 const char kBaseStateAnonymousAccessRole[] = "base.localAnonymousAccessMaxRole";
@@ -55,13 +55,45 @@
               "type": "string"
             }
           }
+        },
+        "reboot": {
+          "minimalRole": "user",
+          "parameters": {},
+          "errors": ["notEnoughBattery"]
+        },
+        "identify": {
+          "minimalRole": "user",
+          "parameters": {}
         }
       },
       "state": {
-        "firmwareVersion": "string",
-        "localDiscoveryEnabled": "boolean",
-        "localAnonymousAccessMaxRole": [ "none", "viewer", "user" ],
-        "localPairingEnabled": "boolean"
+        "firmwareVersion": {
+          "type": "string",
+          "isRequired": true
+        },
+        "localDiscoveryEnabled": {
+          "type": "boolean",
+          "isRequired": true
+        },
+        "localAnonymousAccessMaxRole": {
+          "type": "string",
+          "enum": [ "none", "viewer", "user" ],
+        "isRequired": true
+        },
+        "localPairingEnabled": {
+          "type": "boolean",
+          "isRequired": true
+        },
+        "connectionStatus": {
+          "type": "string"
+        },
+        "network": {
+          "type": "object",
+          "additionalProperties": false,
+          "properties": {
+            "name": { "type": "string" }
+          }
+        }
       }
     }
   })");