def CheckServiceHealth(device, logger, callback):
 def _OnResponse(response):
  response_dict = www_util.ParseJSONResponse(response)
  if (response_dict.get('status') == 'alert'):
   logger.error(_FormatServiceHealthReport(response_dict))
  else:
   logger.info('CheckServiceHealth passed.')
  callback()
 device.SendRequest('service_health', _OnResponse, 'GET')

def CheckServiceHealth ( device , logger , callback ) : def _OnResponse ( response ) : response_dict = www_util . ParseJSONResponse ( response ) if ( response_dict . get ( 'status' ) == 'alert' ) : logger . error ( _FormatServiceHealthReport ( response_dict ) ) else : logger . info ( 'CheckServiceHealth passed.' ) callback ( ) device . SendRequest ( 'service_health' , _OnResponse , 'GET' )
simple scenario which pings the service_health endpoint of the service .