|
1 | 1 | import datetime |
2 | 2 |
|
3 | | -from dataikuapi.dss.utils import DSSTaggableObjectListItem |
4 | | - |
5 | 3 | from .future import DSSFuture |
6 | 4 | import json, warnings |
7 | 5 |
|
| 6 | + |
8 | 7 | class DSSConnectionInfo(dict): |
9 | 8 | """A class holding read-only information about a connection. |
10 | 9 | Do not create this object directly, use :meth:`DSSConnection.get_info` instead. |
@@ -1182,36 +1181,36 @@ def __init__(self, client, data): |
1182 | 1181 |
|
1183 | 1182 | def to_personal_api_key(self): |
1184 | 1183 | """Gets the :class:`DSSPersonalApiKey` corresponding to this item""" |
1185 | | - return DSSPersonalApiKey(self.client, self._data["id"]) |
| 1184 | + return DSSPersonalApiKey(self.client, self["id"]) |
1186 | 1185 |
|
1187 | 1186 | @property |
1188 | 1187 | def id(self): |
1189 | | - return self._data["id"] |
| 1188 | + return self["id"] |
1190 | 1189 |
|
1191 | 1190 | @property |
1192 | 1191 | def user(self): |
1193 | | - return self._data["user"] |
| 1192 | + return self["user"] |
1194 | 1193 |
|
1195 | 1194 | @property |
1196 | 1195 | def key(self): |
1197 | | - return self._data["key"] |
| 1196 | + return self["key"] |
1198 | 1197 |
|
1199 | 1198 | @property |
1200 | 1199 | def label(self): |
1201 | | - return self._data["label"] |
| 1200 | + return self["label"] |
1202 | 1201 |
|
1203 | 1202 | @property |
1204 | 1203 | def description(self): |
1205 | | - return self._data["description"] |
| 1204 | + return self["description"] |
1206 | 1205 |
|
1207 | 1206 | @property |
1208 | 1207 | def created_on(self): |
1209 | | - timestamp = self._data["createdOn"] |
| 1208 | + timestamp = self["createdOn"] |
1210 | 1209 | return datetime.datetime.fromtimestamp(timestamp / 1000) if timestamp > 0 else None |
1211 | 1210 |
|
1212 | 1211 | @property |
1213 | 1212 | def created_by(self): |
1214 | | - return self._data["createdBy"] |
| 1213 | + return self["createdBy"] |
1215 | 1214 |
|
1216 | 1215 |
|
1217 | 1216 | class DSSCluster(object): |
@@ -1350,7 +1349,7 @@ def save(self): |
1350 | 1349 | class DSSClusterStatus(object): |
1351 | 1350 | """ |
1352 | 1351 | The status of a cluster. |
1353 | | - Do not create this object directly, use :meth:`DSSCluster.get_Status` instead. |
| 1352 | + Do not create this object directly, use :meth:`DSSCluster.get_status` instead. |
1354 | 1353 | """ |
1355 | 1354 | def __init__(self, client, cluster_id, status): |
1356 | 1355 | self.client = client |
|
0 commit comments