github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/ces/v1/alarms/results.go (about)

     1  package alarms
     2  
     3  type ListAlarmsResponse struct {
     4  	MetricAlarms []MetricAlarms `json:"metric_alarms,omitempty"`
     5  	MetaData     MetaData       `json:"meta_data,omitempty"`
     6  }
     7  
     8  type MetaData struct {
     9  	Count  int    `json:"count"`
    10  	Total  int    `json:"total"`
    11  	Marker string `json:"marker"`
    12  }
    13  
    14  type MetricAlarms struct {
    15  	// Specifies the alarm rule name.
    16  	AlarmName string `json:"alarm_name"`
    17  	// Provides supplementary information about the alarm rule.
    18  	AlarmDescription string `json:"alarm_description,omitempty"`
    19  	// Specifies the alarm rule type.
    20  	AlarmType string `json:"alarm_type"`
    21  	// Specifies the alarm metric.
    22  	Metric MetricForAlarm `json:"metric"`
    23  	// Specifies the alarm triggering condition.
    24  	Condition Condition `json:"condition"`
    25  	// Specifies whether to enable the alarm rule.
    26  	AlarmEnabled bool `json:"alarm_enabled,omitempty"`
    27  	// Specifies the alarm severity. Possible values are 1, 2, 3 and 4, indicating critical, major, minor, and informational, respectively.
    28  	AlarmLevel int `json:"alarm_level,omitempty"`
    29  	// Specifies whether to enable the action to be triggered by an alarm.
    30  	AlarmActionEnabled bool `json:"alarm_action_enabled,omitempty"`
    31  	// Specifies the action to be triggered by an alarm.
    32  	AlarmActions []AlarmActions `json:"alarm_actions,omitempty"`
    33  	//  Specifies the action to be triggered after the alarm is cleared.
    34  	OkActions []AlarmActions `json:"ok_actions,omitempty"`
    35  	// Specifies the alarm rule ID.
    36  	AlarmId string `json:"alarm_id"`
    37  	// Specifies when the alarm status changed. The value is a UNIX timestamp and the unit is ms.
    38  	UpdateTime int64 `json:"update_time"`
    39  	// Specifies the alarm status. The value can be:
    40  	//
    41  	// ok: The alarm status is normal.
    42  	// alarm: An alarm is generated.
    43  	// insufficient_data: The required data is insufficient.
    44  	AlarmState string `json:"alarm_state"`
    45  }
    46  
    47  type MetricsDimension struct {
    48  	// Specifies the dimension. For example, the ECS dimension is instance_id.
    49  	Name string `json:"name"`
    50  	// Specifies the dimension value, for example, an ECS ID.
    51  	Value string `json:"value"`
    52  }
    53  
    54  type Condition struct {
    55  	// Specifies the operator of alarm thresholds. Possible values are >, =, <, >=, and <=.
    56  	ComparisonOperator string `json:"comparison_operator"`
    57  	// Specifies the number of consecutive occurrence times that the alarm policy was met.
    58  	// The value ranges from 1 to 5.
    59  	Count int `json:"count"`
    60  	// Specifies the data rollup method. The following methods are supported:
    61  	//
    62  	// average: Cloud Eye calculates the average value of metric data within a rollup period.
    63  	// max: Cloud Eye calculates the maximum value of metric data within a rollup period.
    64  	// min: Cloud Eye calculates the minimum value of metric data within a rollup period.
    65  	// sum: Cloud Eye calculates the sum of metric data within a rollup period.
    66  	// variance: Cloud Eye calculates the variance value of metric data within a rollup period.
    67  	Filter string `json:"filter"`
    68  	// Specifies the interval (seconds) for checking whether the configured alarm rules are met.
    69  	Period int `json:"period"`
    70  	// Specifies the data unit. Enter up to 32 characters.
    71  	Unit string `json:"unit,omitempty"`
    72  	// Specifies the alarm threshold. The value ranges from 0 to Number. MAX_VALUE (1.7976931348623157e+108).
    73  	//
    74  	// For detailed thresholds, see the value range of each metric in the appendix.
    75  	// For example, you can set ECS cpu_util in Services Interconnected with Cloud Eye to 80.
    76  	Value float64 `json:"value"`
    77  	// Specifies the interval for triggering an alarm if the alarm persists.
    78  	SuppressDuration int `json:"suppress_duration"`
    79  }
    80  
    81  type AlarmActions struct {
    82  	// Specifies the alarm notification type.
    83  	// notification: indicates that a notification will be sent.
    84  	// autoscaling: indicates that a scaling action will be triggered.
    85  	Type string `json:"type"`
    86  	// Specifies the list of objects to be notified if the alarm status changes.
    87  	// You can configure up to 5 object IDs. You can obtain the topicUrn value from SMN in the following format:
    88  	// urn:smn:([a-z]|[A-Z]|[0-9]|\-){1,32}:([a-z]|[A-Z]|[0-9]){32}:([a-z]|[A-Z]|[0-9]|\-|\_){1,256}.
    89  	// If you set type to notification, you must specify notificationList.
    90  	// If you set type to autoscaling, you must set notificationList to [].
    91  	NotificationList []string `json:"notificationList"`
    92  }