Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(cfg []Config, grpcServer *grpc.Server) ([]*pluginsProto.PluginShort, error)
Register is used to initialize the Opsgenie service and to register it at the given gRPC server.
Types ¶
type Config ¶
type Config struct { Name string `yaml:"name"` Description string `yaml:"description"` ApiKey string `yaml:"apiKey"` ApiUrl string `yaml:"apiUrl"` }
Config is the configuration for an Opsgenie instance. It contains a name, description and an API Key and URL for the Opsgenie API.
type Opsgenie ¶
type Opsgenie struct { opsgenieProto.UnimplementedOpsgenieServer // contains filtered or unexported fields }
func (*Opsgenie) GetAlert ¶
func (o *Opsgenie) GetAlert(ctx context.Context, getAlertRequest *opsgenieProto.GetAlertRequest) (*opsgenieProto.GetAlertResponse, error)
GetAlert implements the GetAlert function of the Opsgenie gRPC service. It returns a single alert by it's id. When the alert was retrieved from the Opsgenie API, we also loop through the returned responders and add the names of the teams by using the team API of Opsgenie.
func (*Opsgenie) GetAlerts ¶
func (o *Opsgenie) GetAlerts(ctx context.Context, getAlertsRequest *opsgenieProto.GetAlertsRequest) (*opsgenieProto.GetAlertsResponse, error)
GetAlerts implements the GetAlerts function for the Opsgenie gRPC service. It returns a list of alert for the given query. Currently the list of results is limited to 100 alerts (Opsgenie API limit). Maybe we can implement a pageination logic later by using the offset parameter.