Documentation ¶
Index ¶
- Constants
- func UnmarshalJSON(b []byte) (influxdb.NotificationEndpoint, error)
- type Base
- func (b Base) GetCRUDLog() influxdb.CRUDLog
- func (b *Base) GetDescription() string
- func (b Base) GetID() influxdb.ID
- func (b *Base) GetName() string
- func (b Base) GetOrgID() influxdb.ID
- func (b *Base) GetStatus() influxdb.Status
- func (b *Base) SetDescription(description string)
- func (b *Base) SetID(id influxdb.ID)
- func (b *Base) SetName(name string)
- func (b *Base) SetOrgID(id influxdb.ID)
- func (b *Base) SetStatus(status influxdb.Status)
- type HTTP
- type PagerDuty
- type Slack
Constants ¶
const ( SlackType = "slack" PagerDutyType = "pagerduty" HTTPType = "http" )
types of endpoints.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalJSON ¶
func UnmarshalJSON(b []byte) (influxdb.NotificationEndpoint, error)
UnmarshalJSON will convert the bytes to notification endpoint.
Types ¶
type Base ¶
type Base struct { ID *influxdb.ID `json:"id,omitempty"` Name string `json:"name"` Description string `json:"description,omitempty"` OrgID *influxdb.ID `json:"orgID,omitempty"` Status influxdb.Status `json:"status"` influxdb.CRUDLog }
Base is the embed struct of every notification endpoint.
func (Base) GetCRUDLog ¶
GetCRUDLog implements influxdb.Getter interface.
func (*Base) GetDescription ¶
GetDescription implements influxdb.Getter interface.
func (*Base) SetDescription ¶
SetDescription implements influxdb.Updator interface.
type HTTP ¶
type HTTP struct { Base // Path is the API path of HTTP URL string `json:"url"` // Token is the bearer token for authorization Headers map[string]string `json:"headers,omitempty"` Token influxdb.SecretField `json:"token,omitempty"` Username influxdb.SecretField `json:"username,omitempty"` Password influxdb.SecretField `json:"password,omitempty"` AuthMethod string `json:"authMethod"` Method string `json:"method"` ContentTemplate string `json:"contentTemplate"` }
HTTP is the notification endpoint config of http.
func (*HTTP) BackfillSecretKeys ¶
func (s *HTTP) BackfillSecretKeys()
BackfillSecretKeys fill back fill the secret field key during the unmarshalling if value of that secret field is not nil.
func (HTTP) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
func (HTTP) ParseResponse ¶
ParseResponse will parse the http response from http.
func (HTTP) SecretFields ¶
func (s HTTP) SecretFields() []influxdb.SecretField
SecretFields return available secret fields.
type PagerDuty ¶
type PagerDuty struct { Base // ClientURL is the url that is presented in the PagerDuty UI when this alert is triggered ClientURL string `json:"clientURL"` // RoutingKey is a version 4 UUID expressed as a 32-digit hexadecimal number. // This is the Integration Key for an integration on any given service. RoutingKey influxdb.SecretField `json:"routingKey"` }
PagerDuty is the notification endpoint config of pagerduty.
func (*PagerDuty) BackfillSecretKeys ¶
func (s *PagerDuty) BackfillSecretKeys()
BackfillSecretKeys fill back fill the secret field key during the unmarshalling if value of that secret field is not nil.
func (PagerDuty) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
func (PagerDuty) SecretFields ¶
func (s PagerDuty) SecretFields() []influxdb.SecretField
SecretFields return available secret fields.
type Slack ¶
type Slack struct { Base // URL is a valid slack webhook URL // TODO(jm): validate this in unmarshaler // example: https://slack.com/api/chat.postMessage URL string `json:"url"` // Token is the bearer token for authorization Token influxdb.SecretField `json:"token"` }
Slack is the notification endpoint config of slack.
func (*Slack) BackfillSecretKeys ¶
func (s *Slack) BackfillSecretKeys()
BackfillSecretKeys fill back fill the secret field key during the unmarshalling if value of that secret field is not nil.
func (Slack) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
func (Slack) SecretFields ¶
func (s Slack) SecretFields() []influxdb.SecretField
SecretFields return available secret fields.