@@ -1109,6 +1109,19 @@ def apply_kubernetes_namespaces_policies(self):
11091109 resp = self ._perform_json ("POST" , "/admin/container-exec/actions/apply-kubernetes-policies" )
11101110 return DSSFuture .from_resp (self , resp )
11111111
1112+
1113+ ########################################################
1114+ # Global Instance Info
1115+ ########################################################
1116+
1117+ def get_instance_info (self ):
1118+ """
1119+ Get global information about the DSS instance
1120+ :return: a :classss:`DSSInstanceInfo`
1121+ """
1122+ resp = self ._perform_json ("GET" , "/instance-info" )
1123+ return DSSInstanceInfo (resp )
1124+
11121125 ########################################################
11131126 # Licensing
11141127 ########################################################
@@ -1233,3 +1246,33 @@ def execute(self, settings=None):
12331246 settings ["_" ] = "_"
12341247 return self .client ._perform_json ("POST" , "/projects/import/%s/process" % (self .import_id ),
12351248 body = settings )
1249+
1250+ class DSSInstanceInfo (object ):
1251+ """Global information about the DSS instance"""
1252+
1253+ def __init__ (self , data ):
1254+ """Do not call this directly, use :meth:`DSSClient.get_instance_info`"""
1255+ self ._data = data
1256+
1257+ @property
1258+ def raw (self ):
1259+ """Returns all data as a Python dictionary"""
1260+ return self ._data
1261+
1262+ @property
1263+ def node_id (self ):
1264+ """Returns the node id (as defined in Cloud Stacks or in install.ini)"""
1265+ return self ._data ["nodeId" ]
1266+
1267+ @property
1268+ def node_name (self ):
1269+ """Returns the node name as it appears in the navigation bar"""
1270+ return self ._data ["nodeName" ]
1271+
1272+ @property
1273+ def node_type (self ):
1274+ """
1275+ Returns the node type
1276+ :return: One of DESIGN, AUTOMATION or DEPLOYER
1277+ """
1278+ return self ._data ["nodeType" ]
0 commit comments