mirror of
https://github.com/gravitational/teleport
synced 2024-10-20 01:03:40 +00:00
Add api ver to path in opsgenie client (#29256)
This commit is contained in:
parent
b122606c3a
commit
9bbd7baf4a
|
@ -123,7 +123,7 @@ func (og Client) CreateAlert(ctx context.Context, reqID string, reqData RequestD
|
||||||
SetContext(ctx).
|
SetContext(ctx).
|
||||||
SetBody(body).
|
SetBody(body).
|
||||||
SetResult(&result).
|
SetResult(&result).
|
||||||
Post("alerts")
|
Post("v2/alerts")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return OpsgenieData{}, trace.Wrap(err)
|
return OpsgenieData{}, trace.Wrap(err)
|
||||||
|
@ -166,7 +166,7 @@ func (og Client) PostReviewNote(ctx context.Context, alertID string, review type
|
||||||
SetBody(body).
|
SetBody(body).
|
||||||
SetPathParams(map[string]string{"alertID": alertID}).
|
SetPathParams(map[string]string{"alertID": alertID}).
|
||||||
SetQueryParams(map[string]string{"identifierType": "id"}).
|
SetQueryParams(map[string]string{"identifierType": "id"}).
|
||||||
Post("alerts/{alertID}/notes")
|
Post("v2/alerts/{alertID}/notes")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return trace.Wrap(err)
|
return trace.Wrap(err)
|
||||||
|
@ -192,7 +192,7 @@ func (og Client) ResolveAlert(ctx context.Context, alertID string, resolution Re
|
||||||
SetBody(body).
|
SetBody(body).
|
||||||
SetPathParams(map[string]string{"alertID": alertID}).
|
SetPathParams(map[string]string{"alertID": alertID}).
|
||||||
SetQueryParams(map[string]string{"identifierType": "id"}).
|
SetQueryParams(map[string]string{"identifierType": "id"}).
|
||||||
Post("alerts/{alertID}/close")
|
Post("v2/alerts/{alertID}/close")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return trace.Wrap(err)
|
return trace.Wrap(err)
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ func (og Client) GetOnCall(ctx context.Context, scheduleName string) (Responders
|
||||||
"flat": "true",
|
"flat": "true",
|
||||||
}).
|
}).
|
||||||
SetResult(&result).
|
SetResult(&result).
|
||||||
Post("schedules/{scheduleName}/on-calls")
|
Post("v2/schedules/{scheduleName}/on-calls")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return RespondersResult{}, trace.Wrap(err)
|
return RespondersResult{}, trace.Wrap(err)
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ func (og Client) CheckHealth(ctx context.Context) error {
|
||||||
resp, err := og.client.NewRequest().
|
resp, err := og.client.NewRequest().
|
||||||
SetContext(ctx).
|
SetContext(ctx).
|
||||||
SetPathParams(map[string]string{"heartbeat": heartbeatName}).
|
SetPathParams(map[string]string{"heartbeat": heartbeatName}).
|
||||||
Get("heartbeats/{heatbeat}/ping")
|
Get("v2/heartbeats/teleport-access-heartbeat/ping")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return trace.Wrap(err)
|
return trace.Wrap(err)
|
||||||
|
|
|
@ -78,7 +78,6 @@ func (c *Config) NewBot(clusterName, webProxyAddr string) (common.MessagingBot,
|
||||||
}
|
}
|
||||||
c.ClientConfig.WebProxyURL = webProxyURL
|
c.ClientConfig.WebProxyURL = webProxyURL
|
||||||
c.ClientConfig.ClusterName = clusterName
|
c.ClientConfig.ClusterName = clusterName
|
||||||
c.ClientConfig.APIKey = c.Opsgenie.Token
|
|
||||||
client, err := NewClient(c.ClientConfig)
|
client, err := NewClient(c.ClientConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, trace.Wrap(err)
|
return nil, trace.Wrap(err)
|
||||||
|
|
Loading…
Reference in a new issue