Entities
Usage
Create an entity
Create an entity from the given name and type without saving it to the database.
create(name: str, type: str, **kwargs)- Params
name: a string defining the name of the entitytype: a string defining the type of the entitykwargs: a dictionary defining further attributes depending on the type of the entity.
- Returns
If the function call succeeds, the created entity is returned. Otherwise, an
ValueErrorexception is raised.
Save an entity
save(name: str, type: str, tags: List[str] = None, **kwargs)Use create function and save entity in the database. Tag the resulting entity with the list of tags if defined.
- Params
name: a string defining the name of the entity to createtype: a string defining the type of the entity to createtags: 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 entity is returned. Otherwise, an
ValueErrorexception is raised.