diff options
Diffstat (limited to 'src/soc_collector/soc_collector_cli.py')
-rw-r--r-- | src/soc_collector/soc_collector_cli.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/soc_collector/soc_collector_cli.py b/src/soc_collector/soc_collector_cli.py index b579108..2398e4f 100644 --- a/src/soc_collector/soc_collector_cli.py +++ b/src/soc_collector/soc_collector_cli.py @@ -115,6 +115,11 @@ def replace_action(data: str) -> None: """ json_data = json_load_data(data) + + if "_id" not in json_data: + print("ERROR: '_id' key not in data") + app_exit(1) + req = requests.put(f"{API_URL}/sc/v0", json=json_data, headers={"API-KEY": API_KEY}, timeout=5, verify=ROOT_CA_FILE) # Check status @@ -136,6 +141,11 @@ def insert_action(data: str) -> None: """ json_data = json_load_data(data) + + if "_id" in json_data: + print("ERROR: '_id' key in data") + app_exit(1) + req = requests.post( f"{API_URL}/sc/v0", json=json_data, headers={"API-KEY": API_KEY}, timeout=5, verify=ROOT_CA_FILE ) |