From 24f8f67071449144549ab6932d9e41da1c8f5c15 Mon Sep 17 00:00:00 2001 From: SeaBlooms Date: Wed, 23 Oct 2024 10:54:59 -0600 Subject: [PATCH] add fetch_entity_raw_data() --- examples/examples.py | 5 +++++ jupiterone/client.py | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/examples/examples.py b/examples/examples.py index a4afe00..fa8b295 100644 --- a/examples/examples.py +++ b/examples/examples.py @@ -110,6 +110,11 @@ print("fetch_all_entity_tags()") print(fetch_all_entity_tags_r) +# fetch_entity_raw_data +fetch_entity_raw_data_r = j1.fetch_entity_raw_data(entity_id="") +print("fetch_entity_raw_data()") +print(json.dumps(fetch_entity_raw_data_r, indent=1)) + # create_integration_instance create_integration_instance_r = j1.create_integration_instance(instance_name="pythonclient-customintegration", instance_description="dev-testing") diff --git a/jupiterone/client.py b/jupiterone/client.py index a92c5ae..8757a26 100644 --- a/jupiterone/client.py +++ b/jupiterone/client.py @@ -33,6 +33,7 @@ INTEGRATION_JOB_VALUES, INTEGRATION_INSTANCE_EVENT_VALUES, ALL_PROPERTIES, + GET_ENTITY_RAW_DATA, CREATE_SMARTCLASS, CREATE_SMARTCLASS_QUERY, EVALUATE_SMARTCLASS, @@ -500,6 +501,19 @@ def fetch_all_entity_tags(self): return return_list + def fetch_entity_raw_data(self, entity_id: str = None): + """Fetch the contents of raw data for a given entity in a J1 Account. + + """ + variables = { + "entityId": entity_id, + "source": "integration-managed" + } + + response = self._execute_query(query=GET_ENTITY_RAW_DATA, variables=variables) + + return response + def start_sync_job(self, instance_id: str = None, sync_mode: str = None, source: str = None,): """Start a synchronization job. @@ -939,4 +953,4 @@ def evaluate_alert_rule(self, rule_id: str = None): } response = self._execute_query(EVALUATE_RULE_INSTANCE, variables=variables) - return response \ No newline at end of file + return response