Skip to content

Commit bcb479f

Browse files
authored
Make client_id configurable (#40)
1 parent f202c61 commit bcb479f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/sumo/wrapper/_call_sumo_api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class CallSumoApi:
77
This class can be used for calling the Sumo APi.
88
"""
99

10-
def __init__(self, env='dev', resource_id=None, outside_token=False):
10+
def __init__(self, env='dev', resource_id=None, client_id=None, outside_token=False):
1111
""" Initialize the wrapper. Chooses among multiple environments."""
1212
if env == 'exp':
1313
self.base_url = 'https://main-sumo-experiment-dev.playground.radix.equinor.com/api/v1'
@@ -17,8 +17,9 @@ def __init__(self, env='dev', resource_id=None, outside_token=False):
1717
self.base_url = f'https://main-sumo-{env}.radix.equinor.com/api/v1'
1818

1919
resource_id = resource_id if resource_id else RESOURCE_ID
20-
21-
self.callAzureApi = CallAzureApi(resource_id, CLIENT_ID, outside_token)
20+
client_id = client_id if client_id else CLIENT_ID
21+
22+
self.callAzureApi = CallAzureApi(resource_id, client_id, outside_token)
2223

2324
def __str__(self):
2425
str_repr = ["{key}='{value}'".format(key=k, value=v) for k, v in self.__dict__.items()]

0 commit comments

Comments
 (0)