@@ -152,7 +152,37 @@ def SSL_trust_all_certs(self, val):
152152 self .__ssl_context .verify_mode = ssl .CERT_REQUIRED
153153
154154
155+ def get_status (self ) -> dict :
156+ '''Executes a health status request to the Kepware instance to report service statuses.
155157
158+ RETURNS:
159+
160+ list - list of data for the health status request
161+
162+ EXCEPTIONS:
163+
164+ KepHTTPError - If urllib provides an HTTPError
165+ KepURLError - If urllib provides an URLError
166+ '''
167+
168+ r = self ._config_get (f'{ self .url } /status' )
169+ return r .payload
170+ def get_info (self ) -> dict :
171+ '''Requests product information from the Kepware instance. Provides various information including
172+ product name and version information.
173+
174+ RETURNS:
175+
176+ dict - data for the product information request
177+
178+ EXCEPTIONS:
179+
180+ KepHTTPError - If urllib provides an HTTPError
181+ KepURLError - If urllib provides an URLError
182+ '''
183+
184+ r = self ._config_get (f'{ self .url } /about' )
185+ return r .payload
156186
157187 def reinitialize (self , job_ttl = None ) -> KepServiceResponse :
158188 '''Executes a Reinitialize call to the Kepware instance.
@@ -337,6 +367,9 @@ def _config_add(self, url, DATA):
337367 '''Conducts an POST method at *url* to add an object in the Kepware Configuration
338368 *DATA* is required to be a properly JSON object (dict) of the item to be posted to *url*
339369 '''
370+ if len (DATA ) == 0 :
371+ err_msg = f'Error: Empty List or Dict in DATA | DATA type: { type (DATA )} '
372+ raise KepError (err_msg )
340373 data = json .dumps (DATA ).encode ('utf-8' )
341374 url_obj = self .__url_validate (url )
342375 q = request .Request (url_obj , data , method = 'POST' )
0 commit comments