@@ -1033,6 +1033,19 @@ def apply_kubernetes_namespaces_policies(self):
10331033 resp = self ._perform_json ("POST" , "/admin/container-exec/actions/apply-kubernetes-policies" )
10341034 return DSSFuture .from_resp (self , resp )
10351035
1036+
1037+ ########################################################
1038+ # Global Instance Info
1039+ ########################################################
1040+
1041+ def get_instance_info (self ):
1042+ """
1043+ Get global information about the DSS instance
1044+ :return: a :classss:`DSSInstanceInfo`
1045+ """
1046+ resp = self ._perform_json ("GET" , "/instance-info" )
1047+ return DSSInstanceInfo (resp )
1048+
10361049 ########################################################
10371050 # Licensing
10381051 ########################################################
@@ -1171,3 +1184,33 @@ def execute(self, settings=None):
11711184 settings ["_" ] = "_"
11721185 return self .client ._perform_json ("POST" , "/projects/import/%s/process" % (self .import_id ),
11731186 body = settings )
1187+
1188+ class DSSInstanceInfo (object ):
1189+ """Global information about the DSS instance"""
1190+
1191+ def __init__ (self , data ):
1192+ """Do not call this directly, use :meth:`DSSClient.get_instance_info`"""
1193+ self ._data = data
1194+
1195+ @property
1196+ def raw (self ):
1197+ """Returns all data as a Python dictionary"""
1198+ return self ._data
1199+
1200+ @property
1201+ def node_id (self ):
1202+ """Returns the node id (as defined in Cloud Stacks or in install.ini)"""
1203+ return self ._data ["nodeId" ]
1204+
1205+ @property
1206+ def node_name (self ):
1207+ """Returns the node name as it appears in the navigation bar"""
1208+ return self ._data ["nodeName" ]
1209+
1210+ @property
1211+ def node_type (self ):
1212+ """
1213+ Returns the node type
1214+ :return: One of DESIGN, AUTOMATION or DEPLOYER
1215+ """
1216+ return self ._data ["nodeType" ]
0 commit comments