Generated Code Documentation¶
Python client for Yuleak API.
-
class
yuleak_api.client.
YuleakClient
¶ Client for Yuleak API.
Class must be used without instance of it.
-
classmethod
credits
()¶ Get current user remaining credits
See https://app.yuleak.com/apidoc#get-credits for endpoint details.
- Returns:
- available credits amount
-
classmethod
dashboards
()¶ Get the current user dashboards list
See https://app.yuleak.com/apidoc#get-dashboards for endpoint details.
- Returns:
- list of Dashboard items
-
classmethod
delete_request
(endpoint, params=None)¶ Make a DELETE request to the API.
- Args:
- endpoint (str): Name of the endpoint to query. params (dict): GET data to send
- Returns:
- (bool) True if the request performed well
-
classmethod
get_request
(endpoint)¶ Make a GET request to the API.
- Args:
- endpoint (str): Name of the endpoint to query.
- Returns:
- a list of items
-
classmethod
post_request
(endpoint, data=None)¶ Make a POST request to the API.
- Args:
- endpoint (str): Name of the endpoint to query. data (dict): Data to send
- Returns:
- (bool) True if the request performed well
-
classmethod
search
(search)¶ Launch a new search (credits will be used). A new dashboard will be created.
See https://app.yuleak.com/apidoc#post-search for endpoint details.
- Args:
- search (str): Expression to search
- Returns:
- (bool) True if the search has been launched
-
classmethod
set_apikey
(apikey)¶ Define the ApiKey to use (by defaut ‘demo’ is used).
- Args:
- apikey (str): ApiKey to use
-
classmethod
-
class
yuleak_api.models.dashboard.
Dashboard
(id_, name)¶ Dashboard model
-
add_filter
(category, value, type_='required')¶ Add a filter to the current dashboard.
See https://app.yuleak.com/apidoc#post-filters for endpoint details.
- Args:
- category (str): Filter category (server, domain, alert, date) value (str): Filter value (all, blacklist, cloudflare …) type_ (str): Filter type: required (by default) or ignored
- Returns:
- True if the filter has been added
-
delete
()¶ Delete the current dashboard and all its data.
See https://app.yuleak.com/apidoc#post-delete for endpoint details.
- Returns:
- (bool) True if the dashboard has been deleted
-
details
()¶ Get the current dashboard servers (similar to details view in WebUI).
See https://app.yuleak.com/apidoc#get-details for endpoint details.
- Returns:
- list of Server items
-
filters
()¶ Get the current dashboard active filters (similar to filters list widget in WebUI).
See https://app.yuleak.com/apidoc#get-filters for endpoint details.
- Returns:
- list of Filter items
-
graph
()¶ Get the current dashboard graph (similar to graph view in WebUI).
See https://app.yuleak.com/apidoc#get-graph for endpoint details.
- Returns:
- list of Node items
-
list_new_servers
()¶ Get list of servers not in resources.
See https://app.yuleak.com/apidoc#get-searchall for endpoint details.
- Returns:
- list of ip (string)
-
map
()¶ Get the current dashboard map markers (similar to map widget in WebUI).
See https://app.yuleak.com/apidoc#get-map for endpoint details.
- Returns:
- list of Marker items
-
renew_all
()¶ Re-launch all resources of the current dashboard.
See https://app.yuleak.com/apidoc#post-renewall for endpoint details.
- Returns:
- (bool) True if the search has been launched
-
renew_cost
()¶ Get the cost to renew all resources
See https://app.yuleak.com/apidoc#get-renewall for endpoint details.
- Returns:
- (int) Amount of credits
-
resources
()¶ Get the current dashboard resources (similar to resources list widget in WebUI).
See https://app.yuleak.com/apidoc#get-resources for endpoint details.
- Returns:
- list of Resource items
-
search
(search)¶ Launch a new search (credits will be used) in the current dashboard.
See https://app.yuleak.com/apidoc#post-search for endpoint details.
- Args:
- search (str): Expression to search
- Returns:
- (bool) True if the search has been launched
-
searchall
()¶ Search all servers not listed in resources (credits will be used).
See https://app.yuleak.com/apidoc#post-searchall for endpoint details.
- Returns:
- (bool) True if the search has been launched
-
stats
()¶ Get the current dashboard statistics (similar to dahboard view in WebUI).
See https://app.yuleak.com/apidoc#get-dashboard for endpoint details.
- Returns:
- dict containing statistics
-
timeline
()¶ Get the current dashboard timeline (similar to timeline widget in WebUI).
See https://app.yuleak.com/apidoc#get-timeline for endpoint details.
- Returns:
- list of Event items
-
-
class
yuleak_api.models.event.
Event
¶ Timeline event model
-
class
yuleak_api.models.filter.
Filter
(dashboard)¶ Filter model.
-
delete
()¶ Delete the current filter
See https://app.yuleak.com/apidoc#delete-filters for endpoint details.
- Returns:
- (bool) True if the filter has been deleted
-
-
class
yuleak_api.models.marker.
Marker
¶ Map marker model
-
class
yuleak_api.models.node.
Node
¶ Graph node model
-
connect
(child)¶ Connect the current node and the child node.
- Args:
- child (Node): Node to connect
-
-
class
yuleak_api.models.resource.
Resource
(dashboard)¶ Resource model.
-
delete
()¶ Delete the current resource and all data linked
See https://app.yuleak.com/apidoc#delete-resources for endpoint details.
- Returns:
- (bool) True if the search has been launched
-
renew
()¶ Launch a new search for the current resource (credits will be consumed)
See https://app.yuleak.com/apidoc#post-renew for endpoint details.
- Returns:
- (bool) True if the search has been launched
-
-
class
yuleak_api.models.server.
Server
(dashboard)¶ Server model
-
add_bookmark
()¶ Add a bookmark to the current server.
See https://app.yuleak.com/apidoc#post-bookmark for endpoint details.
- Returns:
- (bool) True if the bookmark have been added
-
del_bookmark
()¶ Delete the bookmark of the current server.
See https://app.yuleak.com/apidoc#delete-bookmark for endpoint details.
- Returns:
- (bool) True if the bookmark have been deleted
-
-
exception
yuleak_api.errors.
YuleakAPIError
(json_error)¶