v1

package
v0.0.0-...-80f207f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 17 Imported by: 0

README

Alert Policy

Alert policy is a set of rules that define when to trigger an alert. You can create alert policies for your data sources, and set up alert targets to receive alerts.

Guance Cloud supports alert policy management for the results of monitor checks, by sending alert notification emails or group message notifications, so that you can know about the abnormal data situation of the monitoring in time, find problems, and solve problems.

Relationships:

graph LR

A[Monitor] --> B[Alert Policy] --> C[Notification]

Notes:

  1. When a monitor is created, an alert policy must be selected, and the default is selected by default;
  2. When a certain alert policy is deleted, the monitor under the deleted alert policy will automatically be classified into the default.

Documentation

Overview

Code generated by Iacker. DO NOT EDIT IT.

Package v1

Alert Policy

Alert policy is a set of rules that define when to trigger an alert. You can create alert policies for your data sources, and set up alert targets to receive alerts.

Guance Cloud supports alert policy management for the results of monitor checks, by sending alert notification emails or group message notifications, so that you can know about the abnormal data situation of the monitoring in time, find problems, and solve problems.

Relationships:

```mermaid graph LR

A[Monitor] --> B[Alert Policy] --> C[Notification] ```

Notes:

1. When a monitor is created, an alert policy must be selected, and the default is selected by default; 2. When a certain alert policy is deleted, the monitor under the deleted alert policy will automatically be classified into the default.

Index

Constants

View Source
const (
	// AlertPolicyStatusesAll is the value of ALL
	AlertPolicyStatusesAll = "ALL"
	// AlertPolicyStatusesCritical is the value of critical
	AlertPolicyStatusesCritical = "critical"
	// AlertPolicyStatusesError is the value of error
	AlertPolicyStatusesError = "error"
	// AlertPolicyStatusesWarning is the value of warning
	AlertPolicyStatusesWarning = "warning"
	// AlertPolicyStatusesInfo is the value of info
	AlertPolicyStatusesInfo = "info"
	// AlertPolicyStatusesOk is the value of ok
	AlertPolicyStatusesOk = "ok"
	// AlertPolicyStatusesNodata is the value of nodata
	AlertPolicyStatusesNodata = "nodata"
	// AlertPolicyStatusesNodataOk is the value of nodata_ok
	AlertPolicyStatusesNodataOk = "nodata_ok"
	// AlertPolicyStatusesNodataAsOk is the value of nodata_as_ok
	AlertPolicyStatusesNodataAsOk = "nodata_as_ok"
)
View Source
const (
	// AlertTargetTypeMembergroup is the value of Member group
	AlertTargetTypeMembergroup = "member_group"
	// AlertTargetTypeNotification is the value of Notification object
	AlertTargetTypeNotification = "notification"
)
View Source
const ResourceType = "AlertPolicy"

ResourceType is the unique type name of AlertPolicy

Variables

View Source
var File_pkg_resources_alertpolicy_v1_alertpolicy_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AlertPolicy

type AlertPolicy struct {

	// Alert Policy Name
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Silent timeout timestamp
	SilentTimeout *string `protobuf:"bytes,2,opt,name=silent_timeout,json=silentTimeout,proto3,oneof" json:"silent_timeout,omitempty"`
	// The status value of the event to be sent
	Statuses []string `protobuf:"bytes,3,rep,name=statuses,proto3" json:"statuses,omitempty"`
	// Alert Action
	AlertTargets []*AlertTarget `protobuf:"bytes,4,rep,name=alert_targets,json=alertTargets,proto3" json:"alert_targets,omitempty"`
	// contains filtered or unexported fields
}

func (*AlertPolicy) Descriptor deprecated

func (*AlertPolicy) Descriptor() ([]byte, []int)

Deprecated: Use AlertPolicy.ProtoReflect.Descriptor instead.

func (*AlertPolicy) GetAlertTargets

func (x *AlertPolicy) GetAlertTargets() []*AlertTarget

func (*AlertPolicy) GetName

func (x *AlertPolicy) GetName() string

func (*AlertPolicy) GetSilentTimeout

func (x *AlertPolicy) GetSilentTimeout() string

func (*AlertPolicy) GetStatuses

func (x *AlertPolicy) GetStatuses() []string

func (*AlertPolicy) ProtoMessage

func (*AlertPolicy) ProtoMessage()

func (*AlertPolicy) ProtoReflect

func (x *AlertPolicy) ProtoReflect() protoreflect.Message

func (*AlertPolicy) Reset

func (x *AlertPolicy) Reset()

func (*AlertPolicy) String

func (x *AlertPolicy) String() string

func (*AlertPolicy) Validate

func (m *AlertPolicy) Validate() error

Validate checks the field values on AlertPolicy with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*AlertPolicy) ValidateAll

func (m *AlertPolicy) ValidateAll() error

ValidateAll checks the field values on AlertPolicy with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AlertPolicyMultiError, or nil if none found.

type AlertPolicyMultiError

type AlertPolicyMultiError []error

AlertPolicyMultiError is an error wrapping multiple validation errors returned by AlertPolicy.ValidateAll() if the designated constraints aren't met.

func (AlertPolicyMultiError) AllErrors

func (m AlertPolicyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AlertPolicyMultiError) Error

func (m AlertPolicyMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type AlertPolicyValidationError

type AlertPolicyValidationError struct {
	// contains filtered or unexported fields
}

AlertPolicyValidationError is the validation error returned by AlertPolicy.Validate if the designated constraints aren't met.

func (AlertPolicyValidationError) Cause

Cause function returns cause value.

func (AlertPolicyValidationError) Error

Error satisfies the builtin error interface

func (AlertPolicyValidationError) ErrorName

func (e AlertPolicyValidationError) ErrorName() string

ErrorName returns error name.

func (AlertPolicyValidationError) Field

Field function returns field value.

func (AlertPolicyValidationError) Key

Key function returns key value.

func (AlertPolicyValidationError) Reason

Reason function returns reason value.

type AlertTarget

type AlertTarget struct {

	// Alert type
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// Notification
	Notification *TargetNotification `protobuf:"bytes,2,opt,name=notification,proto3" json:"notification,omitempty"`
	// Member Group
	MemberGroup *TargetMemberGroup `protobuf:"bytes,3,opt,name=member_group,json=memberGroup,proto3" json:"member_group,omitempty"`
	// contains filtered or unexported fields
}

func (*AlertTarget) Descriptor deprecated

func (*AlertTarget) Descriptor() ([]byte, []int)

Deprecated: Use AlertTarget.ProtoReflect.Descriptor instead.

func (*AlertTarget) GetMemberGroup

func (x *AlertTarget) GetMemberGroup() *TargetMemberGroup

func (*AlertTarget) GetNotification

func (x *AlertTarget) GetNotification() *TargetNotification

func (*AlertTarget) GetType

func (x *AlertTarget) GetType() string

func (*AlertTarget) ProtoMessage

func (*AlertTarget) ProtoMessage()

func (*AlertTarget) ProtoReflect

func (x *AlertTarget) ProtoReflect() protoreflect.Message

func (*AlertTarget) Reset

func (x *AlertTarget) Reset()

func (*AlertTarget) String

func (x *AlertTarget) String() string

func (*AlertTarget) Validate

func (m *AlertTarget) Validate() error

Validate checks the field values on AlertTarget with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*AlertTarget) ValidateAll

func (m *AlertTarget) ValidateAll() error

ValidateAll checks the field values on AlertTarget with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AlertTargetMultiError, or nil if none found.

type AlertTargetMultiError

type AlertTargetMultiError []error

AlertTargetMultiError is an error wrapping multiple validation errors returned by AlertTarget.ValidateAll() if the designated constraints aren't met.

func (AlertTargetMultiError) AllErrors

func (m AlertTargetMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AlertTargetMultiError) Error

func (m AlertTargetMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type AlertTargetValidationError

type AlertTargetValidationError struct {
	// contains filtered or unexported fields
}

AlertTargetValidationError is the validation error returned by AlertTarget.Validate if the designated constraints aren't met.

func (AlertTargetValidationError) Cause

Cause function returns cause value.

func (AlertTargetValidationError) Error

Error satisfies the builtin error interface

func (AlertTargetValidationError) ErrorName

func (e AlertTargetValidationError) ErrorName() string

ErrorName returns error name.

func (AlertTargetValidationError) Field

Field function returns field value.

func (AlertTargetValidationError) Key

Key function returns key value.

func (AlertTargetValidationError) Reason

Reason function returns reason value.

type TargetMemberGroup

type TargetMemberGroup struct {

	// Member Group
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*TargetMemberGroup) Descriptor deprecated

func (*TargetMemberGroup) Descriptor() ([]byte, []int)

Deprecated: Use TargetMemberGroup.ProtoReflect.Descriptor instead.

func (*TargetMemberGroup) GetId

func (x *TargetMemberGroup) GetId() string

func (*TargetMemberGroup) ProtoMessage

func (*TargetMemberGroup) ProtoMessage()

func (*TargetMemberGroup) ProtoReflect

func (x *TargetMemberGroup) ProtoReflect() protoreflect.Message

func (*TargetMemberGroup) Reset

func (x *TargetMemberGroup) Reset()

func (*TargetMemberGroup) String

func (x *TargetMemberGroup) String() string

func (*TargetMemberGroup) Validate

func (m *TargetMemberGroup) Validate() error

Validate checks the field values on TargetMemberGroup with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*TargetMemberGroup) ValidateAll

func (m *TargetMemberGroup) ValidateAll() error

ValidateAll checks the field values on TargetMemberGroup with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in TargetMemberGroupMultiError, or nil if none found.

type TargetMemberGroupMultiError

type TargetMemberGroupMultiError []error

TargetMemberGroupMultiError is an error wrapping multiple validation errors returned by TargetMemberGroup.ValidateAll() if the designated constraints aren't met.

func (TargetMemberGroupMultiError) AllErrors

func (m TargetMemberGroupMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TargetMemberGroupMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type TargetMemberGroupValidationError

type TargetMemberGroupValidationError struct {
	// contains filtered or unexported fields
}

TargetMemberGroupValidationError is the validation error returned by TargetMemberGroup.Validate if the designated constraints aren't met.

func (TargetMemberGroupValidationError) Cause

Cause function returns cause value.

func (TargetMemberGroupValidationError) Error

Error satisfies the builtin error interface

func (TargetMemberGroupValidationError) ErrorName

ErrorName returns error name.

func (TargetMemberGroupValidationError) Field

Field function returns field value.

func (TargetMemberGroupValidationError) Key

Key function returns key value.

func (TargetMemberGroupValidationError) Reason

Reason function returns reason value.

type TargetNotification

type TargetNotification struct {

	// Notification
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*TargetNotification) Descriptor deprecated

func (*TargetNotification) Descriptor() ([]byte, []int)

Deprecated: Use TargetNotification.ProtoReflect.Descriptor instead.

func (*TargetNotification) GetId

func (x *TargetNotification) GetId() string

func (*TargetNotification) ProtoMessage

func (*TargetNotification) ProtoMessage()

func (*TargetNotification) ProtoReflect

func (x *TargetNotification) ProtoReflect() protoreflect.Message

func (*TargetNotification) Reset

func (x *TargetNotification) Reset()

func (*TargetNotification) String

func (x *TargetNotification) String() string

func (*TargetNotification) Validate

func (m *TargetNotification) Validate() error

Validate checks the field values on TargetNotification with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*TargetNotification) ValidateAll

func (m *TargetNotification) ValidateAll() error

ValidateAll checks the field values on TargetNotification with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in TargetNotificationMultiError, or nil if none found.

type TargetNotificationMultiError

type TargetNotificationMultiError []error

TargetNotificationMultiError is an error wrapping multiple validation errors returned by TargetNotification.ValidateAll() if the designated constraints aren't met.

func (TargetNotificationMultiError) AllErrors

func (m TargetNotificationMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TargetNotificationMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type TargetNotificationValidationError

type TargetNotificationValidationError struct {
	// contains filtered or unexported fields
}

TargetNotificationValidationError is the validation error returned by TargetNotification.Validate if the designated constraints aren't met.

func (TargetNotificationValidationError) Cause

Cause function returns cause value.

func (TargetNotificationValidationError) Error

Error satisfies the builtin error interface

func (TargetNotificationValidationError) ErrorName

ErrorName returns error name.

func (TargetNotificationValidationError) Field

Field function returns field value.

func (TargetNotificationValidationError) Key

Key function returns key value.

func (TargetNotificationValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL