1. The resource's parameter 'parentId' should be resource ID, now it uses resourcepool ID, fix it to resource ID, and the root resource set to None.
2. Make the query with parentId=null can search the root resources.
Signed-off-by: Zhang Rong(Jon) <rong.zhang@windriver.com>
Change-Id: I3eb2f9569d6655755cce25b4464b66c66e5faf51
# 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,
kwargs['resourceTypeName'] = args.resourceTypeName
if args.parentId is not None:
kwargs['parentId'] = args.parentId
+ if args.parentId.lower() == 'null':
+ kwargs['parentId'] = None
+
return ocloud_view.resources(resourcePoolID, bus.uow, **kwargs)