| 1 |
// Package opsgenie provides a notification service for sending alerts to OpsGenie. |
| 2 |
// |
| 3 |
// OpsGenie is an alert management platform that helps teams respond to incidents |
| 4 |
// quickly and efficiently. This package integrates with OpsGenie's REST API to |
| 5 |
// create alerts from various notification sources. |
| 6 |
// |
| 7 |
// # Overview |
| 8 |
// |
| 9 |
// The package implements the shoutrrr Service interface, allowing it to be used |
| 10 |
// as a notification destination for incident management workflows. It supports |
| 11 |
// sending alerts with full customization including priority, responders, tags, |
| 12 |
// actions, and detailed metadata. |
| 13 |
// |
| 14 |
// # URL Scheme |
| 15 |
// |
| 16 |
// The service uses the "opsgenie" URL scheme for configuration: |
| 17 |
// |
| 18 |
// opsgenie://<api-key>?host=<host>&port=<port>&<additional-parameters> |
| 19 |
// |
| 20 |
// # Configuration Examples |
| 21 |
// |
| 22 |
// Basic usage with default US API endpoint: |
| 23 |
// |
| 24 |
// opsgenie://your-api-key-here |
| 25 |
// |
| 26 |
// EU instance configuration: |
| 27 |
// |
| 28 |
// opsgenie://your-api-key-here?host=api.eu.opsgenie.com |
| 29 |
// |
| 30 |
// Full configuration with all options: |
| 31 |
// |
| 32 |
// opsgenie://your-api-key-here?host=api.opsgenie.com&port=443&priority=P1&tags=production,critical&actions=acknowledge,resolve |
| 33 |
// |
| 34 |
// # Key Types |
| 35 |
// |
| 36 |
// The package provides several key types for configuring and sending alerts: |
| 37 |
// |
| 38 |
// Service (opsgenie.go) |
| 39 |
// |
| 40 |
// The main service type that implements the shoutrrr Service interface. |
| 41 |
// Use Initialize() to configure the service with a URL, and Send() to deliver |
| 42 |
// notifications to OpsGenie. |
| 43 |
// |
| 44 |
// Config (opsgenie_config.go) |
| 45 |
// |
| 46 |
// Contains all configuration options for the OpsGenie service: |
| 47 |
// - APIKey: Your OpsGenie API key (required) |
| 48 |
// - Host: API endpoint host (defaults to api.opsgenie.com) |
| 49 |
// - Port: API endpoint port (defaults to 443) |
| 50 |
// - Alert properties: Alias, Description, Responders, VisibleTo, Actions, |
| 51 |
// Tags, Details, Entity, Source, Priority, User, Note, Title |
| 52 |
// |
| 53 |
// Entity (opsgenie_entity.go) |
| 54 |
// |
| 55 |
// Represents OpsGenie entities such as teams, users, escalations, or schedules. |
| 56 |
// Entities are specified using the format "type:identifier" where type can be |
| 57 |
// "team", "user", "escalation", or "schedule", and identifier can be either |
| 58 |
// an ID or name/username. |
| 59 |
// |
| 60 |
// AlertPayload (opsgenie_json.go) |
| 61 |
// |
| 62 |
// Represents the JSON payload sent to the OpsGenie Create Alert API. |
| 63 |
// This struct maps directly to the OpsGenie API request body. |
| 64 |
// |
| 65 |
// # Message Length Limits |
| 66 |
// |
| 67 |
// OpsGenie has a maximum message length of 130 characters. When the message |
| 68 |
// exceeds this limit, the service automatically truncates the message to use |
| 69 |
// as the alert title, while using the full message as the description. |
| 70 |
// |
| 71 |
// # API Endpoints |
| 72 |
// |
| 73 |
// The service sends alerts to the OpsGenie Create Alert API: |
| 74 |
// |
| 75 |
// US Instance: https://api.opsgenie.com/v2/alerts |
| 76 |
// EU Instance: https://api.eu.opsgenie.com/v2/alerts |
| 77 |
// |
| 78 |
// # Authentication |
| 79 |
// |
| 80 |
// Authentication is performed using the OpsGenie API key (GenieKey) passed in |
| 81 |
// the Authorization header: |
| 82 |
// |
| 83 |
// Authorization: GenieKey <api-key> |
| 84 |
// |
| 85 |
// # See Also |
| 86 |
// |
| 87 |
// For more information about the OpsGenie Alert API: |
| 88 |
// https://docs.opsgenie.com/docs/alert-api |
| 89 |
// |
| 90 |
// For more information about OpsGenie priorities: |
| 91 |
// https://docs.opsgenie.com/docs/alert-priority |
| 92 |
// |
| 93 |
// For more information about OpsGenie entity types: |
| 94 |
// https://docs.opsgenie.com/docs/responders |
| 95 |
package opsgenie |