Indicators
Usage
Create an indicator
Create an indicator from the given name, type, pattern and diamond without saving it to the database.
create(name: str, type: str, pattern: str, diamond: DiamondModel, **kwargs)
- Params
name
: a string defining the name of the indicatortype
: a string defining the type of the indicatorpattern
: a string defining the pattern of the indicatordiamond
a string defining the diamond model of the indicatorkwargs
: a dictionary defining further attributes depending on the type of the indicator.
- Returns
If the function call succeeds, the created indicator is returned. Otherwise, an
ValueError
exception is raised.
Save an entity
save(name: str, type: str, pattern: str, diamond: DiamondModel, tags: List[str] = None, **kwargs)
Use create
function and save indicator in the database. Tag the resulting indicator with the list of tags if defined.
- Params
name
: a string defining the name of the indicatortype
: a string defining the type of the indicatorpattern
: a string defining the pattern of the indicatordiamond
a string defining the diamond model of the indicatortags
: an optional list of strings corresponding to the tags to add to the saved observables.kwargs
: a dictionary defining further attributes depending on the type of the entity.
- Returns
If the function call succeeds, the saved indicator is returned. Otherwise, an
ValueError
exception is raised.