1
0
mirror of https://github.com/taigrr/wtf synced 2026-03-31 20:48:44 -07:00

Added to opsgenie module region selection

According to OpsGenie API documentation:
``If using the EU instance of Opsgenie, the URL needs to be https://api.eu.opsgenie.com for requests to be
successful.```
This commit is contained in:
Dmytro Prokhorenkov
2019-07-23 17:23:53 +02:00
parent 7a70ed75be
commit 7422cc3822
2 changed files with 12 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ type Settings struct {
common *cfg.Common
apiKey string `help:"Your OpsGenie API token."`
isEurope bool `help:"Defines if European servers should be used." optional:"true"`
displayEmpty bool `help:"Whether schedules with no assigned person on-call should be displayed." optional:"true"`
schedule []string `help:"A list of names of the schedule(s) to retrieve."`
scheduleIdentifierType string `help:"Type of the schedule identifier." values:"id or name" optional:"true"`
@@ -24,6 +25,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_OPS_GENIE_API_KEY")),
isEurope: ymlConfig.UBool("isEurope", false),
displayEmpty: ymlConfig.UBool("displayEmpty", true),
scheduleIdentifierType: ymlConfig.UString("scheduleIdentifierType", "id"),
}