alarmrule

package
v0.5.20 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionInfo

type ActionInfo struct {
	Type             string   `json:"type"`
	NotificationList []string `json:"notificationList"`
}

type ActionOpts

type ActionOpts struct {
	Type             string   `json:"type" required:"true"`
	NotificationList []string `json:"notificationList" required:"true"`
}

type AlarmRule

type AlarmRule struct {
	AlarmName               string        `json:"alarm_name"`
	AlarmID                 string        `json:"alarm_id"`
	AlarmDescription        string        `json:"alarm_description"`
	AlarmType               string        `json:"alarm_type"`
	AlarmLevel              int           `json:"alarm_level"`
	Metric                  MetricInfo    `json:"metric"`
	Condition               ConditionInfo `json:"condition"`
	AlarmActions            []ActionInfo  `json:"alarm_actions"`
	InsufficientdataActions []ActionInfo  `json:"insufficientdata_actions"`
	OkActions               []ActionInfo  `json:"ok_actions"`
	AlarmEnabled            bool          `json:"alarm_enabled"`
	AlarmActionEnabled      bool          `json:"alarm_action_enabled"`
	UpdateTime              int64         `json:"update_time"`
	AlarmState              string        `json:"alarm_state"`
}

type ConditionInfo

type ConditionInfo struct {
	Period             int    `json:"period"`
	SuppressDuration   int    `json:"suppress_duration,omitempty"`
	Filter             string `json:"filter"`
	ComparisonOperator string `json:"comparison_operator"`
	Value              int    `json:"value"`
	Unit               string `json:"unit"`
	Count              int    `json:"count"`
}

type ConditionOpts

type ConditionOpts struct {
	Period             int    `json:"period" required:"true"`
	SuppressDuration   int    `json:"suppress_duration,omitempty"`
	Filter             string `json:"filter" required:"true"`
	ComparisonOperator string `json:"comparison_operator" required:"true"`
	// The Value ranges from 0 to MAX_VALUE
	Value int    `json:"value"`
	Unit  string `json:"unit,omitempty"`
	Count int    `json:"count" required:"true"`
}

type CreateOpts

type CreateOpts struct {
	AlarmName               string        `json:"alarm_name" required:"true"`
	AlarmDescription        string        `json:"alarm_description,omitempty"`
	AlarmType               string        `json:"alarm_type,omitempty"`
	AlarmLevel              int           `json:"alarm_level,omitempty"`
	Metric                  MetricOpts    `json:"metric" required:"true"`
	Condition               ConditionOpts `json:"condition" required:"true"`
	AlarmActions            []ActionOpts  `json:"alarm_actions,omitempty"`
	InsufficientdataActions []ActionOpts  `json:"insufficientdata_actions,omitempty"`
	OkActions               []ActionOpts  `json:"ok_actions,omitempty"`
	AlarmEnabled            bool          `json:"alarm_enabled"`
	AlarmActionEnabled      bool          `json:"alarm_action_enabled"`
}

func (CreateOpts) ToAlarmRuleCreateMap

func (opts CreateOpts) ToAlarmRuleCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToAlarmRuleCreateMap() (map[string]interface{}, error)
}

type CreateResponse

type CreateResponse struct {
	AlarmID string `json:"alarm_id"`
}

type CreateResult

type CreateResult struct {
	golangsdk.Result
}

func Create

func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

func (CreateResult) Extract

func (c CreateResult) Extract() (*CreateResponse, error)

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

func Delete(c *golangsdk.ServiceClient, id string) (r DeleteResult)

type DimensionInfo

type DimensionInfo struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type DimensionOpts

type DimensionOpts struct {
	Name  string `json:"name" required:"true"`
	Value string `json:"value" required:"true"`
}

type GetResult

type GetResult struct {
	golangsdk.Result
}

func Get

func Get(c *golangsdk.ServiceClient, id string) (r GetResult)

func (GetResult) Extract

func (g GetResult) Extract() (*AlarmRule, error)

type MetricInfo

type MetricInfo struct {
	Namespace  string          `json:"namespace"`
	MetricName string          `json:"metric_name"`
	Dimensions []DimensionInfo `json:"dimensions"`
}

type MetricOpts

type MetricOpts struct {
	Namespace  string          `json:"namespace" required:"true"`
	MetricName string          `json:"metric_name" required:"true"`
	Dimensions []DimensionOpts `json:"dimensions" required:"true"`
}

type UpdateOpts

type UpdateOpts struct {
	AlarmEnabled bool `json:"alarm_enabled"`
}

func (UpdateOpts) ToAlarmRuleUpdateMap

func (opts UpdateOpts) ToAlarmRuleUpdateMap() (map[string]interface{}, error)

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToAlarmRuleUpdateMap() (map[string]interface{}, error)
}

type UpdateResult

type UpdateResult struct {
	golangsdk.ErrResult
}

func Update

func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (r UpdateResult)

Jump to

Keyboard shortcuts

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