def get(self, uuid=None, category_id=None, data_id=None, user_id=None): """Retrieve all object categories or a specific one if sid is given for a given policy :param uuid: uuid of the policy :param category_id: uuid of the object category :param data_id: uuid of the object data :param user_id: user ID who do the request :return: [{ "policy_id": "policy_id1", "category_id": "category_id1", "data": { "object_data_id": { "name": "name of the data", "description": "description of the data" } } }] :internal_api: get_object_data """ try: data = PolicyManager.get_object_data(user_id=user_id, policy_id=uuid, category_id=category_id, data_id=data_id) except Exception as e: logger.error(e, exc_info=True) return {"result": False, "error": str(e)}, 500 return {"object_data": data}
def get(self, uuid=None, category_id=None, data_id=None, user_id=None): """Retrieve all object categories or a specific one if sid is given for a given policy :param uuid: uuid of the policy :param category_id: uuid of the object category :param data_id: uuid of the object data :param user_id: user ID who do the request :return: [{ "policy_id": "policy_id1", "category_id": "category_id1", "data": { "object_data_id": { "name": "name of the data", "description": "description of the data (optional)" } } }] :internal_api: get_object_data """ data = PolicyManager.get_object_data(user_id=user_id, policy_id=uuid, category_id=category_id, data_id=data_id) return {"object_data": data}
def get_object_data(policy_id, data_id=None, category_id=None): from python_moondb.core import PolicyManager return PolicyManager.get_object_data("", policy_id, data_id, category_id)