def get_object(cls): log_debug('Request to Get Objects') result = {} cti_objects = cls.es_client.get_docs(index="stix21") result["status"] = 'success' result["payload"] = cti_objects return result
def find_object(cls, object_id): log_debug(f'Request to Find Object: {object_id}') result = {} try: cti_object = cls.es_client.get_doc(index="stix21", doc_id=object_id) result["status"] = 'success' result["payload"] = { "data": { "id": object_id, "content": cti_object.get('data') } } return result except Exception as e: log_error(e) result["status"] = 'fail' result["payload"] = {"message": "Error (E:2) Object not found .."} return result
def get_discovery(cls): log_debug('Request to Get Discovery Info') taxii_discovery = cls.es_client.get_doc(index='galaxy-discovery', doc_id='discovery') return taxii_discovery['data']