MCPcopy
hub / github.com/apache/caldera / get_facts

Method get_facts

app/api/v2/handlers/fact_api.py:39–49  ·  view source on GitHub ↗
(self, request: web.Request)

Source from the content-addressed store, hash-verified

37 @aiohttp_apispec.response_schema(FactSchema(many=True, partial=True),
38 description='Returns a list of matching facts, dumped in `FactSchema` format.')
39 async def get_facts(self, request: web.Request):
40 fact_data = await self._api_manager.extract_data(request)
41 resp = []
42 if fact_data:
43 try:
44 resp = await self._find_and_verify_facts(fact_data)
45 except Exception as e:
46 error_msg = f'Encountered issue retrieving fact {fact_data} - {e}'
47 self.log.warning(error_msg)
48 raise JsonHttpBadRequest(error_msg)
49 return web.json_response(dict(found=resp))
50
51 @aiohttp_apispec.docs(tags=['facts'],
52 summary='Retrieve Facts by operation id',

Callers 15

all_factsMethod · 0.45
all_factsMethod · 0.45
save_factMethod · 0.45
get_reachable_hostsMethod · 0.45
add_factsMethod · 0.45
delete_factsMethod · 0.45
update_factsMethod · 0.45
test_remove_factMethod · 0.45

Calls 3

JsonHttpBadRequestClass · 0.90
extract_dataMethod · 0.80