With slightly less verbosity:
alarmEvents = system.alarm.queryStatus(state=["ActiveUnacked"])
alarmIds = [str(event.getId()) for event in alarmEvents]
system.alarm.acknowledge(alarmIds, "acked all from script")
With slightly less verbosity:
alarmEvents = system.alarm.queryStatus(state=["ActiveUnacked"])
alarmIds = [str(event.getId()) for event in alarmEvents]
system.alarm.acknowledge(alarmIds, "acked all from script")