def get_alarms(deployment_id, profile='telemetry'):
 auth = _auth(profile=profile)
 try:
  response = requests.get((_get_telemetry_base(profile) + '/alerts?deployment={0}'.format(deployment_id)), headers=auth)
 except requests.exceptions.RequestException as e:
  log.error(str(e))
  return False
 if (response.status_code == 200):
  alarms = response.json()
  if (len(alarms) > 0):
   return alarms
  return 'No alarms defined for deployment: {0}'.format(deployment_id)
 else:
  return {'err_code': response.status_code, 'err_msg': json.loads(response.text).get('err', '')}

def get_alarms ( deployment_id , profile = 'telemetry' ) : auth = _auth ( profile = profile ) try : response = requests . get ( ( _get_telemetry_base ( profile ) + '/alerts?deployment={0}' . format ( deployment_id ) ) , headers = auth ) except requests . exceptions . RequestException as e : log . error ( str ( e ) ) return False if ( response . status_code == 200 ) : alarms = response . json ( ) if ( len ( alarms ) > 0 ) : return alarms return 'No alarms defined for deployment: {0}' . format ( deployment_id ) else : return { 'err_code' : response . status_code , 'err_msg' : json . loads ( response . text ) . get ( 'err' , '' ) }
get all the alarms set up against the current deployment returns dictionary of alarm information cli example: salt myminion telemetry .