File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
import time
3
- import json
4
3
import requests
5
4
from requests .adapters import HTTPAdapter , Retry
6
5
9
8
token = os .environ .get ("JUPITERONE_TOKEN" )
10
9
11
10
# JupiterOne GraphQL API:
12
- j1_graphql_url = "https://graphql.dev .jupiterone.io"
11
+ j1_graphql_url = "https://graphql.us .jupiterone.io"
13
12
14
13
# JupiterOne GraphQL API headers
15
14
j1_graphql_headers = {
63
62
s .mount ('https://' , HTTPAdapter (max_retries = retries ))
64
63
url_response = s .post (j1_graphql_url , headers = j1_graphql_headers , json = payload )
65
64
download_url = url_response .json ()['data' ]['queryV1' ]['url' ]
66
- print (download_url )
65
+ # print(download_url)
67
66
68
67
download_response = s .get (download_url ).json ()
69
68
77
76
status = download_response ['status' ] # update 'status' for next iteration
78
77
79
78
all_query_results .extend (download_response ['data' ]) # add results to all results list
80
- print (len (download_response ['data' ]))
79
+ # print(len(download_response['data']))
81
80
82
81
# Update cursor from response
83
82
if 'cursor' in download_response :
84
83
cursor = download_response ['cursor' ]
85
- print (cursor )
84
+ # print(cursor)
86
85
87
86
else :
88
87
break
89
88
90
- # print(all_query_results)
89
+ print (all_query_results )
91
90
print (len (all_query_results ))
You can’t perform that action at this time.
0 commit comments