Documentation ¶
Index ¶
- func UnmarshalJSON(b []byte) (influxdb.NotificationRule, error)
- type Base
- func (b *Base) ClearPrivateData()
- func (b Base) GetCRUDLog() influxdb.CRUDLog
- func (b *Base) GetDescription() string
- func (b Base) GetEndpointID() influxdb.ID
- func (b Base) GetID() influxdb.ID
- func (b *Base) GetLimit() *influxdb.Limit
- func (b *Base) GetName() string
- func (b Base) GetOrgID() influxdb.ID
- func (b Base) GetOwnerID() influxdb.ID
- func (b Base) GetTaskID() influxdb.ID
- func (b *Base) MatchesTags(tags []influxdb.Tag) bool
- 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) SetOwnerID(id influxdb.ID)
- func (b *Base) SetTaskID(id influxdb.ID)
- type HTTP
- type PagerDuty
- type Slack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnmarshalJSON ¶
UnmarshalJSON will convert
Types ¶
type Base ¶
type Base struct { ID influxdb.ID `json:"id,omitempty"` Name string `json:"name"` Description string `json:"description,omitempty"` EndpointID influxdb.ID `json:"endpointID,omitempty"` OrgID influxdb.ID `json:"orgID,omitempty"` OwnerID influxdb.ID `json:"ownerID,omitempty"` TaskID influxdb.ID `json:"taskID,omitempty"` // SleepUntil is an optional sleeptime to start a task. SleepUntil *time.Time `json:"sleepUntil,omitempty"` Every *notification.Duration `json:"every,omitempty"` // Offset represents a delay before execution. // It gets marshalled from a string duration, i.e.: "10s" is 10 seconds Offset *notification.Duration `json:"offset,omitempty"` RunbookLink string `json:"runbookLink"` TagRules []notification.TagRule `json:"tagRules,omitempty"` StatusRules []notification.StatusRule `json:"statusRules,omitempty"` *influxdb.Limit influxdb.CRUDLog }
Base is the embed struct of every notification rule.
func (*Base) ClearPrivateData ¶
func (b *Base) ClearPrivateData()
ClearPrivateData clears the task ID from the base.
func (Base) GetCRUDLog ¶
func (b Base) GetCRUDLog() influxdb.CRUDLog
GetCRUDLog implements influxdb.Getter interface.
func (*Base) GetDescription ¶
GetDescription implements influxdb.Getter interface.
func (Base) GetEndpointID ¶
func (b Base) GetEndpointID() influxdb.ID
GetEndpointID gets the endpointID for a base.
func (*Base) GetLimit ¶
func (b *Base) GetLimit() *influxdb.Limit
GetLimit returns the limit pointer.
func (Base) GetOrgID ¶
func (b Base) GetOrgID() influxdb.ID
GetOrgID implements influxdb.Getter interface.
func (Base) GetTaskID ¶
func (b Base) GetTaskID() influxdb.ID
GetTaskID gets the task ID for a base.
func (*Base) MatchesTags ¶
MatchesTags returns true if the Rule matches all of the tags
func (*Base) SetDescription ¶
SetDescription implements influxdb.Updator interface.
func (*Base) SetOwnerID ¶
func (b *Base) SetOwnerID(id influxdb.ID)
SetOwnerID will set the owner id.
type HTTP ¶
type HTTP struct {
Base
}
HTTP is the notification rule config of http.
func (*HTTP) GenerateFlux ¶
GenerateFlux generates a flux script for the http notification rule.
func (*HTTP) GenerateFluxAST ¶
GenerateFluxAST generates a flux AST for the http notification rule.
func (HTTP) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
type PagerDuty ¶
PagerDuty is the rule config of pagerduty notification.
func (*PagerDuty) GenerateFlux ¶
GenerateFlux generates a flux script for the pagerduty notification rule.
func (*PagerDuty) GenerateFluxAST ¶
GenerateFluxAST generates a flux AST for the pagerduty notification rule.
func (PagerDuty) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.
type Slack ¶
type Slack struct { Base Channel string `json:"channel"` MessageTemplate string `json:"messageTemplate"` }
Slack is the notification rule config of slack.
func (*Slack) GenerateFlux ¶
GenerateFlux generates a flux script for the slack notification rule.
func (*Slack) GenerateFluxAST ¶
GenerateFluxAST generates a flux AST for the slack notification rule.
func (Slack) MarshalJSON ¶
MarshalJSON implement json.Marshaler interface.