Skip to content

Commit

Permalink
add fetch_entity_raw_data()
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaBlooms committed Oct 23, 2024
1 parent 1c75a7a commit 24f8f67
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions examples/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="<GUID>")
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")
Expand Down
16 changes: 15 additions & 1 deletion jupiterone/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
INTEGRATION_JOB_VALUES,
INTEGRATION_INSTANCE_EVENT_VALUES,
ALL_PROPERTIES,
GET_ENTITY_RAW_DATA,
CREATE_SMARTCLASS,
CREATE_SMARTCLASS_QUERY,
EVALUATE_SMARTCLASS,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -939,4 +953,4 @@ def evaluate_alert_rule(self, rule_id: str = None):
}

response = self._execute_query(EVALUATE_RULE_INSTANCE, variables=variables)
return response
return response

0 comments on commit 24f8f67

Please sign in to comment.