opsgenie-cleanup-utils

command module
v0.0.0-...-4c22bb2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

README

coverage

Features:

  • delete or close alerts based on the provided search query.

    • If no query is provided, then action is taken on ALL alerts visible to the provided API key. Quotes must be escaped if included in the query.
  • purge or delete users

    • purgeUser will remove the user from any schedules, escalations, or teams they are a member of before attempting to remove them.

     THESE ACTIONS ARE EXCEPTIONALLY PERMANENT
PLEASE DO NOT USE THIS PROGRAM UNLESS THAT IS CLEAR

Actions on alerts have a soft limit of 20k at a time.

If more than 20k alerts are returned, you will need to narrow down the query (i.e. specify a date range or a single team) before proceeding.

Usage

CLOSE ALERTS:

opsgenie-cleanup-utilites closeAlerts --apiKey XXXXXX-XXXXXX --query "status:open AND source: \"Phone Call\" AND priority:P1" -v

DELETE ALERTS:

opsgenie-cleanup-utilites deleteAlerts -a XXXXXX-XXXXXX -q "status:open AND source: \"Phone Call\" AND priority:P1" -v

PURGE USERS:

opsgenie-cleanup-utilites purgeUser --apiKey XXXXXX-XXXXXX --user [email protected] -v

DELETE USERS:

opsgenie-cleanup-utilites deleteUser -a XXXXXX-XXXXXX -u [email protected] -v

Both delete and close commands will display matching TinyIDs and Messages for sanity check against expected results.

Pre-compiled versions are in bin/ folder. Run go get bitbucket.org/robert-pratt/opsgenie-cleanup-utilities or go build in root directory to compile your own.

Documentation

Overview

Opsgenie account clean up utility

TODO: Actually set up --eu flag for EU region. TODO: Unit tests and make sure the rate limiting/backoff actually is working. TODO: Allow saved searches instead of manual queries. TODO: Automagically sanitize input to avoid escaping quotes? @author: Robert Pratt <[email protected]> @created: 2019-05-27

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL