SOOPManager#
- class stixcore.soop.manager.SOOPManager(data_root, *, mock_api=False)[source]#
Bases:
objectManages LTP files provided by GFTS
Attributes Summary
Get the data path root directory.
Methods Summary
add_soop_file_to_index(path, *[, rebuild_index])download_all_soops_from_api(ltpname, ...)find_observations(*, start[, end, otype])Search for all observations in the index.
find_soops(*, start[, end])Search for all SOOPs in the index.
get_keywords(*, start[, end, otype])Searches for corresponding entries (SOOPs and Observations) in the index LTPs.
Attributes Documentation
- SOOP_FILE_FILTER = 'SSTX_observation_timeline_export_*.json'#
- SOOP_FILE_REGEX = re.compile('.*SSTX_observation_timeline_export_.*.json$')#
- data_root#
Get the data path root directory.
- Returns:
pathlib.Path– path of the root directory
Methods Documentation
- find_observations(*, start, end=None, otype=SoopObservationType.ALL)[source]#
Search for all observations in the index.
- Parameters:
start (
datetime) – start time to look for overlapping observations in utc timeend (
datetime, optional) – end time to look for overlapping observations in utc time, by default None ()otype (
SoopObservationType, optional) – filter for specific type, by default SoopObservationType.ALL
- Returns:
list– list of foundSOOPObservationin all indexed LTP overlapping the given timeperiod/point and matching the SoopObservationType.
- get_keywords(*, start, end=None, otype=SoopObservationType.ALL)[source]#
Searches for corresponding entries (SOOPs and Observations) in the index LTPs.
Based on all found entries for the filter parameters a list of HeaderKeyword is generated combining all available information.
- Parameters:
start (
datetime) – start time to look for overlapping observations and SOOPs in utc timeend (
datetime, optional) – end time to look for overlapping observations and SOOPs in utc time, by default None ()otype (
SoopObservationType, optional) – filter for specific type of observations, by default SoopObservationType.ALL
- Returns:
list– A list ofHeaderKeyword- Raises:
ValueError – if no SOOPs or Observations where found in the index LTPs for the given filter settings.