mirror of https://github.com/MISP/PyMISP
Merge branch 'tomking2-feature/tagdelete_searchsg' into main
commit
782a3bb863
|
@ -373,6 +373,10 @@ class MISPTag(AbstractMISP):
|
||||||
return {}
|
return {}
|
||||||
return super()._to_feed()
|
return super()._to_feed()
|
||||||
|
|
||||||
|
def delete(self):
|
||||||
|
self.deleted = True
|
||||||
|
self.edited = True
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
if hasattr(self, 'name'):
|
if hasattr(self, 'name'):
|
||||||
return '<{self.__class__.__name__}(name={self.name})>'.format(self=self)
|
return '<{self.__class__.__name__}(name={self.name})>'.format(self=self)
|
||||||
|
|
|
@ -2109,6 +2109,7 @@ class PyMISP:
|
||||||
Tuple[Union[datetime, date, int, str, float, None],
|
Tuple[Union[datetime, date, int, str, float, None],
|
||||||
Union[datetime, date, int, str, float, None]]
|
Union[datetime, date, int, str, float, None]]
|
||||||
]] = None,
|
]] = None,
|
||||||
|
sharinggroup: Optional[List[SearchType]] = None,
|
||||||
pythonify: Optional[bool] = None) -> Union[Dict, List[MISPEvent]]:
|
pythonify: Optional[bool] = None) -> Union[Dict, List[MISPEvent]]:
|
||||||
"""Search only at the index level. Using ! in front of a value means NOT (default is OR)
|
"""Search only at the index level. Using ! in front of a value means NOT (default is OR)
|
||||||
|
|
||||||
|
@ -2123,6 +2124,7 @@ class PyMISP:
|
||||||
:param analysis: Analysis level(s) (0,1,2) | list
|
:param analysis: Analysis level(s) (0,1,2) | list
|
||||||
:param org: Search by the creator organisation by supplying the organisation identifier.
|
:param org: Search by the creator organisation by supplying the organisation identifier.
|
||||||
:param timestamp: Restrict the results by the timestamp (last edit). Any event with a timestamp newer than the given timestamp will be returned. In case you are dealing with /attributes as scope, the attribute's timestamp will be used for the lookup.
|
:param timestamp: Restrict the results by the timestamp (last edit). Any event with a timestamp newer than the given timestamp will be returned. In case you are dealing with /attributes as scope, the attribute's timestamp will be used for the lookup.
|
||||||
|
:param sharinggroup: Restrict by a sharing group | list
|
||||||
:param pythonify: Returns a list of PyMISP Objects instead or the plain json output. Warning: it might use a lot of RAM
|
:param pythonify: Returns a list of PyMISP Objects instead or the plain json output. Warning: it might use a lot of RAM
|
||||||
"""
|
"""
|
||||||
query = locals()
|
query = locals()
|
||||||
|
@ -2132,7 +2134,8 @@ class PyMISP:
|
||||||
query['datefrom'] = self._make_timestamp(query.pop('date_from'))
|
query['datefrom'] = self._make_timestamp(query.pop('date_from'))
|
||||||
if query.get('date_to'):
|
if query.get('date_to'):
|
||||||
query['dateuntil'] = self._make_timestamp(query.pop('date_to'))
|
query['dateuntil'] = self._make_timestamp(query.pop('date_to'))
|
||||||
|
if isinstance(query.get('sharinggroup'), list):
|
||||||
|
query['sharinggroup'] = '|'.join([str(sg) for sg in query['sharinggroup']])
|
||||||
if query.get('timestamp') is not None:
|
if query.get('timestamp') is not None:
|
||||||
timestamp = query.pop('timestamp')
|
timestamp = query.pop('timestamp')
|
||||||
if isinstance(timestamp, (list, tuple)):
|
if isinstance(timestamp, (list, tuple)):
|
||||||
|
|
Loading…
Reference in New Issue