|
3 | 3 | # see https://github.com/PyCQA/pylint/issues/409 |
4 | 4 |
|
5 | 5 | import json |
| 6 | +from warnings import warn |
6 | 7 | from typing import Dict, List |
7 | 8 |
|
8 | 9 | import requests |
@@ -50,11 +51,11 @@ def __init__(self, account: str = None, token: str = None, url: str = DEFAULT_UR |
50 | 51 | self.account = account |
51 | 52 | self.token = token |
52 | 53 | self.url = url |
53 | | - self.query_endpoint = self.url + "/graphql" |
| 54 | + self.query_endpoint = self.url |
54 | 55 | self.rules_endpoint = self.url + "/rules/graphql" |
55 | 56 | self.headers = { |
56 | 57 | "Authorization": "Bearer {}".format(self.token), |
57 | | - "Jupiterone-Account": self.account, |
| 58 | + "JupiterOne-Account": self.account, |
58 | 59 | } |
59 | 60 |
|
60 | 61 | @property |
@@ -90,7 +91,7 @@ def _execute_query(self, query: str, variables: Dict = None) -> Dict: |
90 | 91 | if variables: |
91 | 92 | data.update(variables=variables) |
92 | 93 |
|
93 | | - # Always ask for variableresultsize |
| 94 | + # Always ask for variableResultSize |
94 | 95 | data.update(flags={"variableResultSize": True}) |
95 | 96 |
|
96 | 97 | response = requests.post( |
@@ -124,7 +125,7 @@ def _execute_query(self, query: str, variables: Dict = None) -> Dict: |
124 | 125 | raise JupiterOneApiRetryError("JupiterOne API rate limit exceeded.") |
125 | 126 |
|
126 | 127 | elif response.status_code in [504]: |
127 | | - raise JupiterOneApiRetryError("Bad Gateway error. Check network route and try again.") |
| 128 | + raise JupiterOneApiRetryError("Gateway Timeout.") |
128 | 129 |
|
129 | 130 | elif response.status_code in [500]: |
130 | 131 | raise JupiterOneApiError("JupiterOne API internal server error.") |
|
0 commit comments