From 1c1e8d9f1d394c23099bb5c914c2b917e2505d96 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 15 Apr 2020 19:00:31 +0000 Subject: [PATCH] Generated from 79b081ace1a89974b771830f1320280ae40d817b Update readme.python.md --- .../mgmt/2019-03-01/insights/alertrules.go | 12 +-- .../mgmt/2019-03-01/insights/models.go | 93 ++++++++++++++++--- 2 files changed, 86 insertions(+), 19 deletions(-) diff --git a/services/preview/monitor/mgmt/2019-03-01/insights/alertrules.go b/services/preview/monitor/mgmt/2019-03-01/insights/alertrules.go index bcf0ffa0b7cd..bfd252a868b5 100644 --- a/services/preview/monitor/mgmt/2019-03-01/insights/alertrules.go +++ b/services/preview/monitor/mgmt/2019-03-01/insights/alertrules.go @@ -42,7 +42,7 @@ func NewAlertRulesClientWithBaseURI(baseURI string, subscriptionID string) Alert return AlertRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates an alert rule. +// CreateOrUpdate creates or updates a classic metric alert rule. // Parameters: // resourceGroupName - the name of the resource group. // ruleName - the name of the rule. @@ -131,7 +131,7 @@ func (client AlertRulesClient) CreateOrUpdateResponder(resp *http.Response) (res return } -// Delete deletes an alert rule +// Delete deletes a classic metric alert rule // Parameters: // resourceGroupName - the name of the resource group. // ruleName - the name of the rule. @@ -206,7 +206,7 @@ func (client AlertRulesClient) DeleteResponder(resp *http.Response) (result auto return } -// Get gets an alert rule +// Get gets a classic metric alert rule // Parameters: // resourceGroupName - the name of the resource group. // ruleName - the name of the rule. @@ -282,7 +282,7 @@ func (client AlertRulesClient) GetResponder(resp *http.Response) (result AlertRu return } -// ListByResourceGroup list the alert rules within a resource group. +// ListByResourceGroup list the classic metric alert rules within a resource group. // Parameters: // resourceGroupName - the name of the resource group. func (client AlertRulesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AlertRuleResourceCollection, err error) { @@ -356,7 +356,7 @@ func (client AlertRulesClient) ListByResourceGroupResponder(resp *http.Response) return } -// ListBySubscription list the alert rules within a subscription. +// ListBySubscription list the classic metric alert rules within a subscription. func (client AlertRulesClient) ListBySubscription(ctx context.Context) (result AlertRuleResourceCollection, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.ListBySubscription") @@ -427,7 +427,7 @@ func (client AlertRulesClient) ListBySubscriptionResponder(resp *http.Response) return } -// Update updates an existing AlertRuleResource. To update other fields use the CreateOrUpdate method. +// Update updates an existing classic metric AlertRuleResource. To update other fields use the CreateOrUpdate method. // Parameters: // resourceGroupName - the name of the resource group. // ruleName - the name of the rule. diff --git a/services/preview/monitor/mgmt/2019-03-01/insights/models.go b/services/preview/monitor/mgmt/2019-03-01/insights/models.go index b56931f5fe7b..dc089bbdbf8f 100644 --- a/services/preview/monitor/mgmt/2019-03-01/insights/models.go +++ b/services/preview/monitor/mgmt/2019-03-01/insights/models.go @@ -197,6 +197,40 @@ func PossibleDataStatusValues() []DataStatus { return []DataStatus{NotPresent, Present} } +// DynamicThresholdOperator enumerates the values for dynamic threshold operator. +type DynamicThresholdOperator string + +const ( + // DynamicThresholdOperatorGreaterOrLessThan ... + DynamicThresholdOperatorGreaterOrLessThan DynamicThresholdOperator = "GreaterOrLessThan" + // DynamicThresholdOperatorGreaterThan ... + DynamicThresholdOperatorGreaterThan DynamicThresholdOperator = "GreaterThan" + // DynamicThresholdOperatorLessThan ... + DynamicThresholdOperatorLessThan DynamicThresholdOperator = "LessThan" +) + +// PossibleDynamicThresholdOperatorValues returns an array of possible values for the DynamicThresholdOperator const type. +func PossibleDynamicThresholdOperatorValues() []DynamicThresholdOperator { + return []DynamicThresholdOperator{DynamicThresholdOperatorGreaterOrLessThan, DynamicThresholdOperatorGreaterThan, DynamicThresholdOperatorLessThan} +} + +// DynamicThresholdSensitivity enumerates the values for dynamic threshold sensitivity. +type DynamicThresholdSensitivity string + +const ( + // DynamicThresholdSensitivityHigh ... + DynamicThresholdSensitivityHigh DynamicThresholdSensitivity = "High" + // DynamicThresholdSensitivityLow ... + DynamicThresholdSensitivityLow DynamicThresholdSensitivity = "Low" + // DynamicThresholdSensitivityMedium ... + DynamicThresholdSensitivityMedium DynamicThresholdSensitivity = "Medium" +) + +// PossibleDynamicThresholdSensitivityValues returns an array of possible values for the DynamicThresholdSensitivity const type. +func PossibleDynamicThresholdSensitivityValues() []DynamicThresholdSensitivity { + return []DynamicThresholdSensitivity{DynamicThresholdSensitivityHigh, DynamicThresholdSensitivityLow, DynamicThresholdSensitivityMedium} +} + // Enabled enumerates the values for enabled. type Enabled string @@ -371,6 +405,29 @@ func PossibleOnboardingStatusValues() []OnboardingStatus { return []OnboardingStatus{NotOnboarded, Onboarded, Unknown} } +// Operator enumerates the values for operator. +type Operator string + +const ( + // OperatorEquals ... + OperatorEquals Operator = "Equals" + // OperatorGreaterThan ... + OperatorGreaterThan Operator = "GreaterThan" + // OperatorGreaterThanOrEqual ... + OperatorGreaterThanOrEqual Operator = "GreaterThanOrEqual" + // OperatorLessThan ... + OperatorLessThan Operator = "LessThan" + // OperatorLessThanOrEqual ... + OperatorLessThanOrEqual Operator = "LessThanOrEqual" + // OperatorNotEquals ... + OperatorNotEquals Operator = "NotEquals" +) + +// PossibleOperatorValues returns an array of possible values for the Operator const type. +func PossibleOperatorValues() []Operator { + return []Operator{OperatorEquals, OperatorGreaterThan, OperatorGreaterThanOrEqual, OperatorLessThan, OperatorLessThanOrEqual, OperatorNotEquals} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -2139,10 +2196,10 @@ type Dimension struct { // DynamicMetricCriteria criterion for dynamic threshold. type DynamicMetricCriteria struct { - // Operator - The operator used to compare the metric value against the threshold. - Operator interface{} `json:"operator,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 interface{} `json:"alertSensitivity,omitempty"` + // Operator - The operator used to compare the metric value against the threshold. Possible values include: 'DynamicThresholdOperatorGreaterThan', 'DynamicThresholdOperatorLessThan', 'DynamicThresholdOperatorGreaterOrLessThan' + Operator DynamicThresholdOperator `json:"operator,omitempty"` + // AlertSensitivity - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. Possible values include: 'DynamicThresholdSensitivityLow', 'DynamicThresholdSensitivityMedium', 'DynamicThresholdSensitivityHigh' + AlertSensitivity DynamicThresholdSensitivity `json:"alertSensitivity,omitempty"` // FailingPeriods - The minimum number of violations required within the selected lookback time window required to raise an alert. FailingPeriods *DynamicThresholdFailingPeriods `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) @@ -2167,10 +2224,10 @@ type DynamicMetricCriteria struct { func (dmc DynamicMetricCriteria) MarshalJSON() ([]byte, error) { dmc.CriterionType = CriterionTypeDynamicThresholdCriterion objectMap := make(map[string]interface{}) - if dmc.Operator != nil { + if dmc.Operator != "" { objectMap["operator"] = dmc.Operator } - if dmc.AlertSensitivity != nil { + if dmc.AlertSensitivity != "" { objectMap["alertSensitivity"] = dmc.AlertSensitivity } if dmc.FailingPeriods != nil { @@ -2234,7 +2291,7 @@ func (dmc *DynamicMetricCriteria) UnmarshalJSON(body []byte) error { switch k { case "operator": if v != nil { - var operator interface{} + var operator DynamicThresholdOperator err = json.Unmarshal(*v, &operator) if err != nil { return err @@ -2243,7 +2300,7 @@ func (dmc *DynamicMetricCriteria) UnmarshalJSON(body []byte) error { } case "alertSensitivity": if v != nil { - var alertSensitivity interface{} + var alertSensitivity DynamicThresholdSensitivity err = json.Unmarshal(*v, &alertSensitivity) if err != nil { return err @@ -3655,7 +3712,7 @@ type MetricAlertProperties struct { TargetResourceRegion *string `json:"targetResourceRegion,omitempty"` // Criteria - defines the specific alert criteria information. Criteria BasicMetricAlertCriteria `json:"criteria,omitempty"` - // AutoMitigate - the flag that indicates whether the alert should be auto resolved or not. + // AutoMitigate - the flag that indicates whether the alert should be auto resolved or not. The default is true. AutoMitigate *bool `json:"autoMitigate,omitempty"` // Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. Actions *[]MetricAlertAction `json:"actions,omitempty"` @@ -4112,8 +4169,8 @@ type MetricBaselinesResponse struct { // MetricCriteria criterion to filter metrics. type MetricCriteria struct { - // Operator - the criteria operator. - Operator interface{} `json:"operator,omitempty"` + // Operator - the criteria operator. Possible values include: 'OperatorEquals', 'OperatorNotEquals', 'OperatorGreaterThan', 'OperatorGreaterThanOrEqual', 'OperatorLessThan', 'OperatorLessThanOrEqual' + Operator Operator `json:"operator,omitempty"` // Threshold - the criteria threshold value that activates the alert. Threshold *float64 `json:"threshold,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection @@ -4136,7 +4193,7 @@ type MetricCriteria struct { func (mc MetricCriteria) MarshalJSON() ([]byte, error) { mc.CriterionType = CriterionTypeStaticThresholdCriterion objectMap := make(map[string]interface{}) - if mc.Operator != nil { + if mc.Operator != "" { objectMap["operator"] = mc.Operator } if mc.Threshold != nil { @@ -4197,7 +4254,7 @@ func (mc *MetricCriteria) UnmarshalJSON(body []byte) error { switch k { case "operator": if v != nil { - var operator interface{} + var operator Operator err = json.Unmarshal(*v, &operator) if err != nil { return err @@ -5740,6 +5797,16 @@ type WebhookReceiver struct { UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` } +// WebtestLocationAvailabilityCriteria specifies the metric alert rule criteria for a web test resource. +type WebtestLocationAvailabilityCriteria struct { + // WebTestID - The Application Insights web test Id. + WebTestID *string `json:"webTestId,omitempty"` + // ComponentID - The Application Insights resource Id. + ComponentID *string `json:"componentId,omitempty"` + // FailedLocationCount - The number of failed locations. + FailedLocationCount *float64 `json:"failedLocationCount,omitempty"` +} + // WorkspaceInfo information about a Log Analytics Workspace. type WorkspaceInfo struct { // ID - Azure Resource Manager identifier of the Log Analytics Workspace.