JSONFeedApiModule
Common code that will be appended into each JSON Feed integration when it's deployed.
python · ApiModules
Details
| ID | JSONFeedApiModule |
|---|---|
| Language | python |
| From Version | 5.5.0 |
| Docker Image | demisto/py3-tools:1.0.0.108682 |
| Tags | infra server |
README
To use the common JSON feed API logic, run the following command to import the JSONFeedApiModule.
The module expects the feed to be configured with the following parameters:
Per sub-feed name:
- URL
jmespathextractor- indicator name
- indicator type
See the below example:
def main():
...
feed_name_to_config = {
'AMAZON': {
'url': 'https://ip-ranges.amazonaws.com/ip-ranges.json',
'extractor': "prefixes[?service=='AMAZON']",
'indicator': 'ip_prefix',
'indicator_type': FeedIndicatorType.IP,
}
}
params = {k: v for k, v in demisto.params().items() if v is not None}
params['feed_name_to_config'] = feed_name_to_config
feed_main(params, 'AWS Feed')
from JSONFeedApiModule import * # noqa: E402
if __name__ in ["builtins", "__main__"]:
main()
comment: Common code that will be appended into each JSON Feed integration when it's deployed. commonfields: id: JSONFeedApiModule version: -1 name: JSONFeedApiModule script: '-' subtype: python3 system: true tags: - infra - server timeout: 0s type: python dockerimage: demisto/py3-tools:1.0.0.108682 dependson: {} fromversion: 5.5.0 tests: - No tests (auto formatted)