Add api_versions support; update model of ocloud, resourcepool, and resource
[pti/o2.git] / o2ims / service / auditor / pserver_handler.py
index f5df381..884f276 100644 (file)
@@ -47,7 +47,7 @@ def update_pserver(
         res = uow.session.execute(
             '''
             SELECT "resourceTypeId", "oCloudId", "name"
-            FROM resourcetype
+            FROM "resourceType"
             WHERE "resourceTypeEnum" = :resource_type_enum
             ''',
             dict(resource_type_enum=stxobj.type.name)
@@ -97,7 +97,7 @@ def create_by(stxobj: StxGenericModel, parentid: str, resourcetype_id: str) \
     # content = json.loads(stxobj.content)
     resourcetype_id = resourcetype_id
     resourcepool_id = parentid
-    parent_id = parentid
+    parent_id = None  # the root of the resource has no parent id
     gAssetId = ''  # TODO: global ID
     description = "A physical server resource"
     resource = Resource(stxobj.id, resourcetype_id, resourcepool_id,