Skip to content

Commit 4f47137

Browse files
committed
New API for auth_info and connection location_info
1 parent f345c2b commit 4f47137

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

dataikuapi/dss/admin.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,27 @@ class DSSConnection(object):
88
def __init__(self, client, name):
99
self.client = client
1010
self.name = name
11+
12+
########################################################
13+
# Location info
14+
########################################################
15+
16+
def get_location_info(self):
17+
"""
18+
Gets information about this connection.
19+
20+
Note: this call requires either an admin API key or
21+
a personal API key that corresponds to a user who
22+
belongs to a group who has the rights to read connection
23+
details
24+
25+
:returns: a dict containing connection information
26+
"""
27+
return self.client._perform_json(
28+
"GET", "/connections/%s/info" % self.name)
1129

1230
########################################################
13-
# User deletion
31+
# Connection deletion
1432
########################################################
1533

1634
def delete(self):

dataikuapi/dssclient.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,18 @@ def catalog_index_connections(self, connection_names=[], all_connections=False,
706706
"indexingMode": indexing_mode
707707
})
708708

709+
710+
########################################################
711+
# Auth
712+
########################################################
713+
714+
def get_auth_info(self, with_secrets=False):
715+
return self._perform_json("GET", "/auth/info", params={"withSecrets": with_secrets})
716+
717+
def get_auth_info_from_browser_headers(self, headers_dict, with_secrets=False):
718+
return self._perform_json("POST", "/auth/info-from-browser-headers",
719+
params={"withSecrets": with_secrets}, body=headers_dict)
720+
709721
########################################################
710722
# Internal Request handling
711723
########################################################
@@ -769,6 +781,7 @@ def get_object_discussions(self, project_key, object_type, object_id):
769781
"""
770782
return DSSObjectDiscussions(self, project_key, object_type, object_id)
771783

784+
772785
class TemporaryImportHandle(object):
773786
def __init__(self, client, import_id):
774787
self.client = client

0 commit comments

Comments
 (0)