/
metric_alert_status_arm_types_gen.go
307 lines (236 loc) · 13 KB
/
metric_alert_status_arm_types_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1api20180301
import (
"encoding/json"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)
type MetricAlert_STATUS_ARM struct {
// Id: Azure resource Id
Id *string `json:"id,omitempty"`
// Location: Resource location
Location *string `json:"location,omitempty"`
// Name: Azure resource name
Name *string `json:"name,omitempty"`
// Properties: The alert rule properties of the resource.
Properties *MetricAlertProperties_STATUS_ARM `json:"properties,omitempty"`
// Tags: Resource tags
Tags map[string]string `json:"tags,omitempty"`
// Type: Azure resource type
Type *string `json:"type,omitempty"`
}
// An alert rule.
type MetricAlertProperties_STATUS_ARM struct {
// Actions: the array of actions that are performed when the alert rule becomes active, and when an alert condition is
// resolved.
Actions []MetricAlertAction_STATUS_ARM `json:"actions,omitempty"`
// AutoMitigate: the flag that indicates whether the alert should be auto resolved or not. The default is true.
AutoMitigate *bool `json:"autoMitigate,omitempty"`
// Criteria: defines the specific alert criteria information.
Criteria *MetricAlertCriteria_STATUS_ARM `json:"criteria,omitempty"`
// Description: the description of the metric alert that will be included in the alert email.
Description *string `json:"description,omitempty"`
// Enabled: the flag that indicates whether the metric alert is enabled.
Enabled *bool `json:"enabled,omitempty"`
// EvaluationFrequency: how often the metric alert is evaluated represented in ISO 8601 duration format.
EvaluationFrequency *string `json:"evaluationFrequency,omitempty"`
// IsMigrated: the value indicating whether this alert rule is migrated.
IsMigrated *bool `json:"isMigrated,omitempty"`
// LastUpdatedTime: Last time the rule was updated in ISO8601 format.
LastUpdatedTime *string `json:"lastUpdatedTime,omitempty"`
// Scopes: the list of resource id's that this metric alert is scoped to.
Scopes []string `json:"scopes,omitempty"`
// Severity: Alert severity {0, 1, 2, 3, 4}
Severity *int `json:"severity,omitempty"`
// TargetResourceRegion: the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope
// contains a subscription, resource group, or more than one resource.
TargetResourceRegion *string `json:"targetResourceRegion,omitempty"`
// TargetResourceType: the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the
// scope contains a subscription, resource group, or more than one resource.
TargetResourceType *string `json:"targetResourceType,omitempty"`
// WindowSize: the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the
// threshold.
WindowSize *string `json:"windowSize,omitempty"`
}
// An alert action.
type MetricAlertAction_STATUS_ARM struct {
// ActionGroupId: the id of the action group to use.
ActionGroupId *string `json:"actionGroupId,omitempty"`
// WebHookProperties: This field allows specifying custom properties, which would be appended to the alert payload sent as
// input to the webhook.
WebHookProperties map[string]string `json:"webHookProperties,omitempty"`
}
type MetricAlertCriteria_STATUS_ARM struct {
// MicrosoftAzureMonitorMultipleResourceMultipleMetric: Mutually exclusive with all other properties
MicrosoftAzureMonitorMultipleResourceMultipleMetric *MetricAlertMultipleResourceMultipleMetricCriteria_STATUS_ARM `json:"microsoftAzureMonitorMultipleResourceMultipleMetricCriteria,omitempty"`
// MicrosoftAzureMonitorSingleResourceMultipleMetric: Mutually exclusive with all other properties
MicrosoftAzureMonitorSingleResourceMultipleMetric *MetricAlertSingleResourceMultipleMetricCriteria_STATUS_ARM `json:"microsoftAzureMonitorSingleResourceMultipleMetricCriteria,omitempty"`
// MicrosoftAzureMonitorWebtestLocationAvailability: Mutually exclusive with all other properties
MicrosoftAzureMonitorWebtestLocationAvailability *WebtestLocationAvailabilityCriteria_STATUS_ARM `json:"microsoftAzureMonitorWebtestLocationAvailabilityCriteria,omitempty"`
}
// MarshalJSON defers JSON marshaling to the first non-nil property, because MetricAlertCriteria_STATUS_ARM represents a discriminated union (JSON OneOf)
func (criteria MetricAlertCriteria_STATUS_ARM) MarshalJSON() ([]byte, error) {
if criteria.MicrosoftAzureMonitorMultipleResourceMultipleMetric != nil {
return json.Marshal(criteria.MicrosoftAzureMonitorMultipleResourceMultipleMetric)
}
if criteria.MicrosoftAzureMonitorSingleResourceMultipleMetric != nil {
return json.Marshal(criteria.MicrosoftAzureMonitorSingleResourceMultipleMetric)
}
if criteria.MicrosoftAzureMonitorWebtestLocationAvailability != nil {
return json.Marshal(criteria.MicrosoftAzureMonitorWebtestLocationAvailability)
}
return nil, nil
}
// UnmarshalJSON unmarshals the MetricAlertCriteria_STATUS_ARM
func (criteria *MetricAlertCriteria_STATUS_ARM) UnmarshalJSON(data []byte) error {
var rawJson map[string]interface{}
err := json.Unmarshal(data, &rawJson)
if err != nil {
return err
}
discriminator := rawJson["odata.type"]
if discriminator == "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" {
criteria.MicrosoftAzureMonitorMultipleResourceMultipleMetric = &MetricAlertMultipleResourceMultipleMetricCriteria_STATUS_ARM{}
return json.Unmarshal(data, criteria.MicrosoftAzureMonitorMultipleResourceMultipleMetric)
}
if discriminator == "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" {
criteria.MicrosoftAzureMonitorSingleResourceMultipleMetric = &MetricAlertSingleResourceMultipleMetricCriteria_STATUS_ARM{}
return json.Unmarshal(data, criteria.MicrosoftAzureMonitorSingleResourceMultipleMetric)
}
if discriminator == "Microsoft.Azure.Monitor.WebtestLocationAvailabilityCriteria" {
criteria.MicrosoftAzureMonitorWebtestLocationAvailability = &WebtestLocationAvailabilityCriteria_STATUS_ARM{}
return json.Unmarshal(data, criteria.MicrosoftAzureMonitorWebtestLocationAvailability)
}
// No error
return nil
}
type MetricAlertMultipleResourceMultipleMetricCriteria_STATUS_ARM struct {
AdditionalProperties map[string]v1.JSON `json:"additionalProperties,omitempty"`
// AllOf: the list of multiple metric criteria for this 'all of' operation.
AllOf []MultiMetricCriteria_STATUS_ARM `json:"allOf,omitempty"`
// OdataType: specifies the type of the alert criteria.
OdataType MetricAlertMultipleResourceMultipleMetricCriteria_OdataType_STATUS `json:"odata.type,omitempty"`
}
type MetricAlertSingleResourceMultipleMetricCriteria_STATUS_ARM struct {
AdditionalProperties map[string]v1.JSON `json:"additionalProperties,omitempty"`
// AllOf: The list of metric criteria for this 'all of' operation.
AllOf []MetricCriteria_STATUS_ARM `json:"allOf,omitempty"`
// OdataType: specifies the type of the alert criteria.
OdataType MetricAlertSingleResourceMultipleMetricCriteria_OdataType_STATUS `json:"odata.type,omitempty"`
}
type WebtestLocationAvailabilityCriteria_STATUS_ARM struct {
AdditionalProperties map[string]v1.JSON `json:"additionalProperties,omitempty"`
// ComponentId: The Application Insights resource Id.
ComponentId *string `json:"componentId,omitempty"`
// FailedLocationCount: The number of failed locations.
FailedLocationCount *float64 `json:"failedLocationCount,omitempty"`
// OdataType: specifies the type of the alert criteria.
OdataType WebtestLocationAvailabilityCriteria_OdataType_STATUS `json:"odata.type,omitempty"`
// WebTestId: The Application Insights web test Id.
WebTestId *string `json:"webTestId,omitempty"`
}
type MetricCriteria_STATUS_ARM struct {
AdditionalProperties map[string]v1.JSON `json:"additionalProperties,omitempty"`
// CriterionType: Specifies the type of threshold criteria
CriterionType MetricCriteria_CriterionType_STATUS `json:"criterionType,omitempty"`
// Dimensions: List of dimension conditions.
Dimensions []MetricDimension_STATUS_ARM `json:"dimensions,omitempty"`
// MetricName: Name of the metric.
MetricName *string `json:"metricName,omitempty"`
// MetricNamespace: Namespace of the metric.
MetricNamespace *string `json:"metricNamespace,omitempty"`
// Name: Name of the criteria.
Name *string `json:"name,omitempty"`
// Operator: the criteria operator.
Operator *MetricCriteria_Operator_STATUS `json:"operator,omitempty"`
// SkipMetricValidation: Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric
// validation to be skipped.
SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"`
// Threshold: the criteria threshold value that activates the alert.
Threshold *float64 `json:"threshold,omitempty"`
// TimeAggregation: the criteria time aggregation types.
TimeAggregation *MetricCriteria_TimeAggregation_STATUS `json:"timeAggregation,omitempty"`
}
type MultiMetricCriteria_STATUS_ARM struct {
// Dynamic: Mutually exclusive with all other properties
Dynamic *DynamicMetricCriteria_STATUS_ARM `json:"dynamicThresholdCriterion,omitempty"`
// Static: Mutually exclusive with all other properties
Static *MetricCriteria_STATUS_ARM `json:"staticThresholdCriterion,omitempty"`
}
// MarshalJSON defers JSON marshaling to the first non-nil property, because MultiMetricCriteria_STATUS_ARM represents a discriminated union (JSON OneOf)
func (criteria MultiMetricCriteria_STATUS_ARM) MarshalJSON() ([]byte, error) {
if criteria.Dynamic != nil {
return json.Marshal(criteria.Dynamic)
}
if criteria.Static != nil {
return json.Marshal(criteria.Static)
}
return nil, nil
}
// UnmarshalJSON unmarshals the MultiMetricCriteria_STATUS_ARM
func (criteria *MultiMetricCriteria_STATUS_ARM) UnmarshalJSON(data []byte) error {
var rawJson map[string]interface{}
err := json.Unmarshal(data, &rawJson)
if err != nil {
return err
}
discriminator := rawJson["criterionType"]
if discriminator == "DynamicThresholdCriterion" {
criteria.Dynamic = &DynamicMetricCriteria_STATUS_ARM{}
return json.Unmarshal(data, criteria.Dynamic)
}
if discriminator == "StaticThresholdCriterion" {
criteria.Static = &MetricCriteria_STATUS_ARM{}
return json.Unmarshal(data, criteria.Static)
}
// No error
return nil
}
type DynamicMetricCriteria_STATUS_ARM struct {
AdditionalProperties map[string]v1.JSON `json:"additionalProperties,omitempty"`
// AlertSensitivity: The extent of deviation required to trigger an alert. This will affect how tight the threshold is to
// the metric series pattern.
AlertSensitivity *DynamicMetricCriteria_AlertSensitivity_STATUS `json:"alertSensitivity,omitempty"`
// CriterionType: Specifies the type of threshold criteria
CriterionType DynamicMetricCriteria_CriterionType_STATUS `json:"criterionType,omitempty"`
// Dimensions: List of dimension conditions.
Dimensions []MetricDimension_STATUS_ARM `json:"dimensions,omitempty"`
// FailingPeriods: The minimum number of violations required within the selected lookback time window required to raise an
// alert.
FailingPeriods *DynamicThresholdFailingPeriods_STATUS_ARM `json:"failingPeriods,omitempty"`
// IgnoreDataBefore: Use this option to set the date from which to start learning the metric historical data and calculate
// the dynamic thresholds (in ISO8601 format)
IgnoreDataBefore *string `json:"ignoreDataBefore,omitempty"`
// MetricName: Name of the metric.
MetricName *string `json:"metricName,omitempty"`
// MetricNamespace: Namespace of the metric.
MetricNamespace *string `json:"metricNamespace,omitempty"`
// Name: Name of the criteria.
Name *string `json:"name,omitempty"`
// Operator: The operator used to compare the metric value against the threshold.
Operator *DynamicMetricCriteria_Operator_STATUS `json:"operator,omitempty"`
// SkipMetricValidation: Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric
// validation to be skipped.
SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"`
// TimeAggregation: the criteria time aggregation types.
TimeAggregation *DynamicMetricCriteria_TimeAggregation_STATUS `json:"timeAggregation,omitempty"`
}
// Specifies a metric dimension.
type MetricDimension_STATUS_ARM struct {
// Name: Name of the dimension.
Name *string `json:"name,omitempty"`
// Operator: the dimension operator. Only 'Include' and 'Exclude' are supported
Operator *string `json:"operator,omitempty"`
// Values: list of dimension values.
Values []string `json:"values,omitempty"`
}
// The minimum number of violations required within the selected lookback time window required to raise an alert.
type DynamicThresholdFailingPeriods_STATUS_ARM struct {
// MinFailingPeriodsToAlert: The number of violations to trigger an alert. Should be smaller or equal to
// numberOfEvaluationPeriods.
MinFailingPeriodsToAlert *float64 `json:"minFailingPeriodsToAlert,omitempty"`
// NumberOfEvaluationPeriods: The number of aggregated lookback points. The lookback time window is calculated based on the
// aggregation granularity (windowSize) and the selected number of aggregated points.
NumberOfEvaluationPeriods *float64 `json:"numberOfEvaluationPeriods,omitempty"`
}