WebCaller¶
-
class
humiolib.WebCaller.
WebCaller
(base_url)¶ Object used for abstracting calls to the Humio API
-
call_graphql
(headers=None, data=None, **kwargs)¶ Call Humio’s GraphQL endpoint
Parameters: - headers (dict, optional) – Http headers
- data (dict, optional) – Post request body for GraphQL
Returns: Response to web request
Return type: Response Object
-
call_rest
(verb, endpoint, headers=None, data=None, files=None, stream=False, **kwargs)¶ Call one of Humio’s REST endpoints
Parameters: - verb (str) – Http verb
- endpoint (str) – Called Humio endpoint
- headers (dict, optional) – Http headers
- data (dict, optional) – Post request body
- files (dict, optional) – Files to be posted
- stream (bool, optional) – Indicates whether a stream request should be made
Returns: Response to web request
Return type: Response Object
-
static
response_as_json
(func)¶ Wrapper to take the raw requests responses and turn them into json
Parameters: func (Function) – Function to be wrapped. Returns: Result of function, parsed into python objects from json Return type: dict
-
-
class
humiolib.WebCaller.
WebStreamer
(connection)¶ Wrapper for a web request stream. Its main purpose is to catch errors during stream and raise them again as custom Humio exceptions.