Comment 1 for bug 1664696

Revision history for this message
Jim Baker (jimbaker) wrote :

Some example code to return the desired object type;
it is sort of unfortunate we also have `device_type`!

diff --git a/craton/api/v1/schemas.py b/craton/api/v1/schemas.py
index 3fecf2c..a7f68e2 100644
--- a/craton/api/v1/schemas.py
+++ b/craton/api/v1/schemas.py
@@ -76,6 +76,10 @@ DefinitionsHost = {
             "type": "integer",
             "description": "Parent Id of this host",
         },
+ "type": {
+ "type": "string",
+ "description": "Type of this resource",
+ },
         "device_type": {
             "type": "string",
             "description": "Type of host",
@@ -136,6 +140,10 @@ DefinitionsHostId = {
             },
             "description": "User defined labels",
         },
+ "type": {
+ "type": "string",
+ "description": "Type of resource",
+ },
         "device_type": {
             "type": "string",
             "description": "Type of host",