opsgenie

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

Opsgenie

Actions for Opsgenie

Prerequisites

  • Opsgenie account: You need to have an Opsgenie account and the necessary permissions to create alerts.
  • API key: You need to create an integration API key. You can find management console at https://<your-opsgenie-tenant>/settings/integrations/

opsgenie.create_alert

This action creates an alert in Opsgenie.

Arguments

Example policy:

run contains job if {
  job := {
    id: "your-action",
    uses: "opsgenie.create_alert",
    args: {
      "secret_api_key": input.env.OPSGENIE_API_KEY,
      "responders": [
        {
          "id": "3f68caf0-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "type": "team",
        },
      ],
    }
  }
}
  • secret_api_key (string, required): Specifies the API key for Opsgenie.
  • responders (array of structure, optional): Specifies the responders of the alert. See https://docs.opsgenie.com/docs/alert-api#section-create-alert for details.
    • id (string): Specifies the ID of the responder.
    • name (string): Specifies the name of the responder.
    • username (string): Specifies the username of the responder.
    • type (string, required): Specifies the type of the responder. Possible values are team, user, escalation and schedule.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAlert

func CreateAlert(ctx context.Context, alert model.Alert, args model.ActionArgs) (any, error)

Types

type Responder

type Responder struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	UserName string `json:"username"`
	Type     string `json:"type"`
}

Jump to

Keyboard shortcuts

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