Python API Doc
Setup
- api.set_araalictl_path(new_path)
set the location of araalictl on this node.
- Parameters:
new_path (string) – araalictl path
- api.auth(token)
authorize araalictl for api use. This operation is idempotent and can be run multiple times without any side effect App.
- Parameters:
token (string) – token is generated from a manually authenticated araalictl
- api.deauth()
deauth araalictl from this node.
App
- class api.App
A class representing an application
Usage:
>>> import api >>> app = api.App("nightly", "bendvm") >>> for link in app.iterlinks(): ... link.accept() ... >>> app.review() >>> app.commit()
- Parameters:
zone (string) – name of the zone
app (string) – name of the app
- review()
Review edits made to links in the app. Links can be accepted, denied or snoozed.
- commit()
Commit changes made to links in the app.
Link
- class api.Link
Class representing an individual link (policy suggestion). Links can be accepted or snoozed. Accepted links become whitelist policies for the app, while snoozed links will appear again if new flows are observed.
Usage:
>>> for link in app.iterlinks(): ... link.accept() ...
- accept()
Accept link as whitelisted policy.
- snooze()
Snooze link. A snoozed link is forgotten. It will show up again if a new flow is observed. Typically links are snoozed when the underlying problem is addressed. It is snoozed so that there is notification on subsequent occurrence.
- deny()
Deny link. A denied link is snoozed forever. You not only want to not accept it, but you dont even want to snooze because you are aware of it and dont want to accept it, ever!
LinkTable
- class api.LinkTable
Class representing an arbitrary table/collection of links (policies), that allows action on multiple links at the same time. Links can be filtered at init, so only filtered links enter the table.
Subsequently action can be taken on all links in the filtered table, or by specifying specific indices. Links can be committed back on a per app basis or for the entire runtime (which essentially iterates over every app in the runtime).
Usage:
>>> links = api.LinkTable(app.iterlinks()) >>> links = links.accept(0,2) >>> app.review() >>> app.commit()
- Parameters:
links (list of api.Link) – a list of link objects
*filters (lambda returning boolean) – filter to be applied on the input (of links). An arbitrary number of filters can be specified. There are some predefined filters in the api for common use: api.f.*
- accept(*args)
Accept link by index number. If no index is provided, all links in the table will be accepted.
- Parameters:
args (any number of int's) – Multiple indices can be passed
- deny(*args)
Deny link by index number. If no index is provided, all links in the table will be denied.
- Parameters:
args (any number of int's) – Multiple indices can be passed
- snooze(*args)
Snooze link by index number. If no index is provided, all links in the table will be snoozed.
- Parameters:
args (any number of int's) – Multiple indices can be passed