#!/bin/bash # PATCH alert status by alert id. # Usage: ./alert_status.sh [status] # alert_id - required, the alert id (e.g. from GET /reslevis/alerts) # status - optional, default: resolved # Example: ./alert_status.sh abc-123 resolved # BASE_URL=http://host:port ./alert_status.sh abc-123 acknowledged SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" . "${SCRIPT_DIR}/../_common.sh" ALERT_ID="${1:?Usage: $0 [status]}" STATUS="${2:-resolved}" curl -s -X PATCH "${BASE_URL}/reslevis/alerts/${ALERT_ID}" \ -H "Content-Type: application/json" \ -d "{\"status\": \"${STATUS}\"}" echo ""