-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(observability-lib): add timerange to alert rule
- Loading branch information
Showing
4 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package rule | ||
|
||
import ( | ||
"github.com/smartcontractkit/chainlink-common/observability-lib/api" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var deleteCmd = &cobra.Command{ | ||
Use: "delete [name]", | ||
Short: "Delete rule by UID", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
grafanaClient := api.NewClient( | ||
cmd.Flag("grafana-url").Value.String(), | ||
cmd.Flag("grafana-token").Value.String(), | ||
) | ||
|
||
_, _, errDelete := grafanaClient.DeleteAlertRule(args[0]) | ||
if errDelete != nil { | ||
return errDelete | ||
} | ||
|
||
return nil | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package rule | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var Cmd = &cobra.Command{ | ||
Use: "rule [actions]", | ||
Short: "Perform actions on dashboard", | ||
} | ||
|
||
func init() { | ||
Cmd.AddCommand(deleteCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters