Skip to content

Commit 24f8f67

Browse files
committed
add fetch_entity_raw_data()
1 parent 1c75a7a commit 24f8f67

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

examples/examples.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@
110110
print("fetch_all_entity_tags()")
111111
print(fetch_all_entity_tags_r)
112112

113+
# fetch_entity_raw_data
114+
fetch_entity_raw_data_r = j1.fetch_entity_raw_data(entity_id="<GUID>")
115+
print("fetch_entity_raw_data()")
116+
print(json.dumps(fetch_entity_raw_data_r, indent=1))
117+
113118
# create_integration_instance
114119
create_integration_instance_r = j1.create_integration_instance(instance_name="pythonclient-customintegration",
115120
instance_description="dev-testing")

jupiterone/client.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
INTEGRATION_JOB_VALUES,
3434
INTEGRATION_INSTANCE_EVENT_VALUES,
3535
ALL_PROPERTIES,
36+
GET_ENTITY_RAW_DATA,
3637
CREATE_SMARTCLASS,
3738
CREATE_SMARTCLASS_QUERY,
3839
EVALUATE_SMARTCLASS,
@@ -500,6 +501,19 @@ def fetch_all_entity_tags(self):
500501

501502
return return_list
502503

504+
def fetch_entity_raw_data(self, entity_id: str = None):
505+
"""Fetch the contents of raw data for a given entity in a J1 Account.
506+
507+
"""
508+
variables = {
509+
"entityId": entity_id,
510+
"source": "integration-managed"
511+
}
512+
513+
response = self._execute_query(query=GET_ENTITY_RAW_DATA, variables=variables)
514+
515+
return response
516+
503517
def start_sync_job(self, instance_id: str = None, sync_mode: str = None, source: str = None,):
504518
"""Start a synchronization job.
505519
@@ -939,4 +953,4 @@ def evaluate_alert_rule(self, rule_id: str = None):
939953
}
940954

941955
response = self._execute_query(EVALUATE_RULE_INSTANCE, variables=variables)
942-
return response
956+
return response

0 commit comments

Comments
 (0)