From 3fad7a9bd7f73e3dc82795063d10fcc1380b6980 Mon Sep 17 00:00:00 2001 From: SeaBlooms Date: Mon, 23 Sep 2024 13:24:32 -0600 Subject: [PATCH 1/3] updating README --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7d15849..b50b5a7 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ Requires Python 3.6+ `pip install jupiterone` - ## Usage ##### Create a new client: @@ -23,16 +22,25 @@ from jupiterone import JupiterOneClient j1 = JupiterOneClient( account='', token='', - url='https://graphql.us.jupiterone.io' + url='https://graphql.us.jupiterone.io', + sync_url='https://api.us.jupiterone.io' ) ``` -For users with J1 accounts in the EU region, the 'url' parameter will need to be updated to "https://graphql.eu.jupiterone.io". -If no 'url' parameter is passed, the default of "https://graphql.us.jupiterone.io" is used. +## Regional or Custom Tenant Support + +For users with J1 accounts in the EU region for example, +the 'url' parameter will need to be updated to "https://graphql.eu.jupiterone.io" +and the 'sync_url' parameter will need to be updated to "https://api.eu.jupiterone.io". + +If no 'url' parameter is passed, +the default of "https://graphql.us.jupiterone.io" is used, +and if no 'sync_url' paramter is passed, +the default of "https://api.us.jupiterone.io" is used. -##### Method Exmaples: +## Method Examples: -See the examples/examples.py for full usage example documentation +### *See the examples/examples.py for full usage example documentation ##### Execute a query: @@ -111,3 +119,29 @@ j1.create_relationship( ```python j1.delete_relationship(relationship_id='') ``` + +##### Fetch Graph Entity Properties + +```python +j1.fetch_all_entity_properties() +``` + +##### Fetch Graph Entity Tags + +```python +j1.fetch_all_entity_tags() +``` + +##### Create Integration Instance + +```python +j1.create_integration_instance( + instance_name="Integration Name", + instance_description="Description Text") +``` + +##### Start Synrchonization Job + +```python +j1.start_sync_job(instance_id='') +``` \ No newline at end of file From 3f7154ae15cae3c8a8608a3c3849ebb6a9ddfc96 Mon Sep 17 00:00:00 2001 From: SeaBlooms Date: Mon, 23 Sep 2024 13:42:02 -0600 Subject: [PATCH 2/3] Update README.md --- README.md | 170 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 168 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b50b5a7..e4631e1 100644 --- a/README.md +++ b/README.md @@ -140,8 +140,174 @@ j1.create_integration_instance( instance_description="Description Text") ``` -##### Start Synrchonization Job +##### Start Synchronization Job ```python j1.start_sync_job(instance_id='') -``` \ No newline at end of file +``` + +##### Upload Batch of Entities + +```python +entities_payload = [ + { + "_key": "1", + "_type": "pythonclient", + "_class": "API", + "displayName": "pythonclient1", + "propertyName": "value" + }, + { + "_key": "2", + "_type": "pythonclient", + "_class": "API", + "displayName": "pythonclient2", + "propertyName": "value" + }, + { + "_key": "3", + "_type": "pythonclient", + "_class": "API", + "displayName": "pythonclient3", + "propertyName": "value" + } +] + +j1.upload_entities_batch_json(instance_job_id='', + entities_list=entities_payload) +``` + +##### Upload Batch of Relationships + +```python +relationships_payload = [ + { + "_key": "1:2", + "_class": "EXTENDS", + "_type": "pythonclient_extends_pythonclient", + "_fromEntityKey": "1", + "_toEntityKey": "2", + "relationshipProperty": "value" + }, + { + "_key": "2:3", + "_class": "EXTENDS", + "_type": "pythonclient_extends_pythonclient", + "_fromEntityKey": "2", + "_toEntityKey": "3", + "relationshipProperty": "value" + } +] + +j1.upload_relationships_batch_json(instance_job_id='', + relationships_list=relationships_payload) +``` + +##### Upload Batch of Entities and Relationships + +```python +combined_payload = { + "entities": [ + { + "_key": "4", + "_type": "pythonclient", + "_class": "API", + "displayName": "pythonclient4", + "propertyName": "value" + }, + { + "_key": "5", + "_type": "pythonclient", + "_class": "API", + "displayName": "pythonclient5", + "propertyName": "value" + }, + { + "_key": "6", + "_type": "pythonclient", + "_class": "API", + "displayName": "pythonclient6", + "propertyName": "value" + } +], + "relationships": [ + { + "_key": "4:5", + "_class": "EXTENDS", + "_type": "pythonclient_extends_pythonclient", + "_fromEntityKey": "4", + "_toEntityKey": "5", + "relationshipProperty": "value" + }, + { + "_key": "5:6", + "_class": "EXTENDS", + "_type": "pythonclient_extends_pythonclient", + "_fromEntityKey": "5", + "_toEntityKey": "6", + "relationshipProperty": "value" + } +] +} + +j1.upload_combined_batch_json(instance_job_id='', + combined_payload=combined_payload) +``` + +##### Finalize Synchronization Job + +```python +j1.finalize_sync_job(instance_job_id='') +``` + +##### Fetch Integration Instance Jobs + +```python +j1.fetch_integration_jobs(instance_id='') +``` + +##### Fetch Integration Instance Job Events + +```python +j1.fetch_integration_job_events(instance_id='', + instance_job_id='') +``` + +##### Create SmartClass + +```python +j1.create_smartclass(smartclass_name='SmartClassName', + smartclass_description='SmartClass Description Text') +``` + +##### Create SmartClass Query + +```python +j1.create_smartclass_query(smartclass_id='', + query='', + query_description='Query Description Text') +``` + +##### Run SmartClass Evaluation + +```python +j1.evaluate_smartclass(smartclass_id='') +``` + +##### Get SmartClass Details + +```python +j1.get_smartclass_details(smartclass_id='') +``` + +##### List Alert Rules + +```python +j1.list_configured_alert_rules() +``` + +##### Generate J1QL from Natural Language Prompt + +```python +j1.generate_j1ql(natural_language_prompt='') +``` From 6e87370a333870daaa597c20afc6c19b50c2d73d Mon Sep 17 00:00:00 2001 From: SeaBlooms Date: Mon, 23 Sep 2024 14:32:11 -0600 Subject: [PATCH 3/3] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4631e1..b0daa05 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ and the 'sync_url' parameter will need to be updated to "https://api.eu.jupitero If no 'url' parameter is passed, the default of "https://graphql.us.jupiterone.io" is used, -and if no 'sync_url' paramter is passed, +and if no 'sync_url' parameter is passed, the default of "https://api.us.jupiterone.io" is used. ## Method Examples: