diff --git a/profiles/latest/monitor/mgmt/insights/models.go b/profiles/latest/monitor/mgmt/insights/models.go
deleted file mode 100644
index b8efe4a8812a..000000000000
--- a/profiles/latest/monitor/mgmt/insights/models.go
+++ /dev/null
@@ -1,415 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package insights
-
-import original "github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-09-01/insights"
-
-const (
- DefaultBaseURI = original.DefaultBaseURI
-)
-
-type AggregationType = original.AggregationType
-
-const (
- Average AggregationType = original.Average
- Count AggregationType = original.Count
- Maximum AggregationType = original.Maximum
- Minimum AggregationType = original.Minimum
- None AggregationType = original.None
- Total AggregationType = original.Total
-)
-
-type CategoryType = original.CategoryType
-
-const (
- Logs CategoryType = original.Logs
- Metrics CategoryType = original.Metrics
-)
-
-type ComparisonOperationType = original.ComparisonOperationType
-
-const (
- Equals ComparisonOperationType = original.Equals
- GreaterThan ComparisonOperationType = original.GreaterThan
- GreaterThanOrEqual ComparisonOperationType = original.GreaterThanOrEqual
- LessThan ComparisonOperationType = original.LessThan
- LessThanOrEqual ComparisonOperationType = original.LessThanOrEqual
- NotEquals ComparisonOperationType = original.NotEquals
-)
-
-type ConditionOperator = original.ConditionOperator
-
-const (
- ConditionOperatorGreaterThan ConditionOperator = original.ConditionOperatorGreaterThan
- ConditionOperatorGreaterThanOrEqual ConditionOperator = original.ConditionOperatorGreaterThanOrEqual
- ConditionOperatorLessThan ConditionOperator = original.ConditionOperatorLessThan
- ConditionOperatorLessThanOrEqual ConditionOperator = original.ConditionOperatorLessThanOrEqual
-)
-
-type EventLevel = original.EventLevel
-
-const (
- Critical EventLevel = original.Critical
- Error EventLevel = original.Error
- Informational EventLevel = original.Informational
- Verbose EventLevel = original.Verbose
- Warning EventLevel = original.Warning
-)
-
-type MetricStatisticType = original.MetricStatisticType
-
-const (
- MetricStatisticTypeAverage MetricStatisticType = original.MetricStatisticTypeAverage
- MetricStatisticTypeMax MetricStatisticType = original.MetricStatisticTypeMax
- MetricStatisticTypeMin MetricStatisticType = original.MetricStatisticTypeMin
- MetricStatisticTypeSum MetricStatisticType = original.MetricStatisticTypeSum
-)
-
-type OdataType = original.OdataType
-
-const (
- OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource OdataType = original.OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource
- OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource OdataType = original.OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource
- OdataTypeRuleDataSource OdataType = original.OdataTypeRuleDataSource
-)
-
-type OdataTypeBasicRuleAction = original.OdataTypeBasicRuleAction
-
-const (
- OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction OdataTypeBasicRuleAction = original.OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction
- OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction OdataTypeBasicRuleAction = original.OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction
- OdataTypeRuleAction OdataTypeBasicRuleAction = original.OdataTypeRuleAction
-)
-
-type OdataTypeBasicRuleCondition = original.OdataTypeBasicRuleCondition
-
-const (
- OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition OdataTypeBasicRuleCondition = original.OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition
- OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition OdataTypeBasicRuleCondition = original.OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition
- OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition OdataTypeBasicRuleCondition = original.OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition
- OdataTypeRuleCondition OdataTypeBasicRuleCondition = original.OdataTypeRuleCondition
-)
-
-type ReceiverStatus = original.ReceiverStatus
-
-const (
- Disabled ReceiverStatus = original.Disabled
- Enabled ReceiverStatus = original.Enabled
- NotSpecified ReceiverStatus = original.NotSpecified
-)
-
-type RecurrenceFrequency = original.RecurrenceFrequency
-
-const (
- RecurrenceFrequencyDay RecurrenceFrequency = original.RecurrenceFrequencyDay
- RecurrenceFrequencyHour RecurrenceFrequency = original.RecurrenceFrequencyHour
- RecurrenceFrequencyMinute RecurrenceFrequency = original.RecurrenceFrequencyMinute
- RecurrenceFrequencyMonth RecurrenceFrequency = original.RecurrenceFrequencyMonth
- RecurrenceFrequencyNone RecurrenceFrequency = original.RecurrenceFrequencyNone
- RecurrenceFrequencySecond RecurrenceFrequency = original.RecurrenceFrequencySecond
- RecurrenceFrequencyWeek RecurrenceFrequency = original.RecurrenceFrequencyWeek
- RecurrenceFrequencyYear RecurrenceFrequency = original.RecurrenceFrequencyYear
-)
-
-type ResultType = original.ResultType
-
-const (
- Data ResultType = original.Data
- Metadata ResultType = original.Metadata
-)
-
-type ScaleDirection = original.ScaleDirection
-
-const (
- ScaleDirectionDecrease ScaleDirection = original.ScaleDirectionDecrease
- ScaleDirectionIncrease ScaleDirection = original.ScaleDirectionIncrease
- ScaleDirectionNone ScaleDirection = original.ScaleDirectionNone
-)
-
-type ScaleType = original.ScaleType
-
-const (
- ChangeCount ScaleType = original.ChangeCount
- ExactCount ScaleType = original.ExactCount
- PercentChangeCount ScaleType = original.PercentChangeCount
-)
-
-type Sensitivity = original.Sensitivity
-
-const (
- High Sensitivity = original.High
- Low Sensitivity = original.Low
- Medium Sensitivity = original.Medium
-)
-
-type TimeAggregationOperator = original.TimeAggregationOperator
-
-const (
- TimeAggregationOperatorAverage TimeAggregationOperator = original.TimeAggregationOperatorAverage
- TimeAggregationOperatorLast TimeAggregationOperator = original.TimeAggregationOperatorLast
- TimeAggregationOperatorMaximum TimeAggregationOperator = original.TimeAggregationOperatorMaximum
- TimeAggregationOperatorMinimum TimeAggregationOperator = original.TimeAggregationOperatorMinimum
- TimeAggregationOperatorTotal TimeAggregationOperator = original.TimeAggregationOperatorTotal
-)
-
-type TimeAggregationType = original.TimeAggregationType
-
-const (
- TimeAggregationTypeAverage TimeAggregationType = original.TimeAggregationTypeAverage
- TimeAggregationTypeCount TimeAggregationType = original.TimeAggregationTypeCount
- TimeAggregationTypeMaximum TimeAggregationType = original.TimeAggregationTypeMaximum
- TimeAggregationTypeMinimum TimeAggregationType = original.TimeAggregationTypeMinimum
- TimeAggregationTypeTotal TimeAggregationType = original.TimeAggregationTypeTotal
-)
-
-type Unit = original.Unit
-
-const (
- UnitBytes Unit = original.UnitBytes
- UnitByteSeconds Unit = original.UnitByteSeconds
- UnitBytesPerSecond Unit = original.UnitBytesPerSecond
- UnitCount Unit = original.UnitCount
- UnitCountPerSecond Unit = original.UnitCountPerSecond
- UnitMilliSeconds Unit = original.UnitMilliSeconds
- UnitPercent Unit = original.UnitPercent
- UnitSeconds Unit = original.UnitSeconds
- UnitUnspecified Unit = original.UnitUnspecified
-)
-
-type ActionGroup = original.ActionGroup
-type ActionGroupList = original.ActionGroupList
-type ActionGroupPatch = original.ActionGroupPatch
-type ActionGroupPatchBody = original.ActionGroupPatchBody
-type ActionGroupResource = original.ActionGroupResource
-type ActionGroupsClient = original.ActionGroupsClient
-type ActivityLogAlert = original.ActivityLogAlert
-type ActivityLogAlertActionGroup = original.ActivityLogAlertActionGroup
-type ActivityLogAlertActionList = original.ActivityLogAlertActionList
-type ActivityLogAlertAllOfCondition = original.ActivityLogAlertAllOfCondition
-type ActivityLogAlertLeafCondition = original.ActivityLogAlertLeafCondition
-type ActivityLogAlertList = original.ActivityLogAlertList
-type ActivityLogAlertPatch = original.ActivityLogAlertPatch
-type ActivityLogAlertPatchBody = original.ActivityLogAlertPatchBody
-type ActivityLogAlertResource = original.ActivityLogAlertResource
-type ActivityLogAlertsClient = original.ActivityLogAlertsClient
-type ActivityLogsClient = original.ActivityLogsClient
-type AlertRule = original.AlertRule
-type AlertRuleIncidentsClient = original.AlertRuleIncidentsClient
-type AlertRuleResource = original.AlertRuleResource
-type AlertRuleResourceCollection = original.AlertRuleResourceCollection
-type AlertRuleResourcePatch = original.AlertRuleResourcePatch
-type AlertRulesClient = original.AlertRulesClient
-type AutomationRunbookReceiver = original.AutomationRunbookReceiver
-type AutoscaleNotification = original.AutoscaleNotification
-type AutoscaleProfile = original.AutoscaleProfile
-type AutoscaleSetting = original.AutoscaleSetting
-type AutoscaleSettingResource = original.AutoscaleSettingResource
-type AutoscaleSettingResourceCollection = original.AutoscaleSettingResourceCollection
-type AutoscaleSettingResourceCollectionIterator = original.AutoscaleSettingResourceCollectionIterator
-type AutoscaleSettingResourceCollectionPage = original.AutoscaleSettingResourceCollectionPage
-type AutoscaleSettingResourcePatch = original.AutoscaleSettingResourcePatch
-type AutoscaleSettingsClient = original.AutoscaleSettingsClient
-type AzureAppPushReceiver = original.AzureAppPushReceiver
-type BaseClient = original.BaseClient
-type Baseline = original.Baseline
-type BaselineMetadataValue = original.BaselineMetadataValue
-type BaselineProperties = original.BaselineProperties
-type BaselineResponse = original.BaselineResponse
-type BasicRuleAction = original.BasicRuleAction
-type BasicRuleCondition = original.BasicRuleCondition
-type BasicRuleDataSource = original.BasicRuleDataSource
-type CalculateBaselineResponse = original.CalculateBaselineResponse
-type DiagnosticSettings = original.DiagnosticSettings
-type DiagnosticSettingsCategory = original.DiagnosticSettingsCategory
-type DiagnosticSettingsCategoryClient = original.DiagnosticSettingsCategoryClient
-type DiagnosticSettingsCategoryResource = original.DiagnosticSettingsCategoryResource
-type DiagnosticSettingsCategoryResourceCollection = original.DiagnosticSettingsCategoryResourceCollection
-type DiagnosticSettingsClient = original.DiagnosticSettingsClient
-type DiagnosticSettingsResource = original.DiagnosticSettingsResource
-type DiagnosticSettingsResourceCollection = original.DiagnosticSettingsResourceCollection
-type EmailNotification = original.EmailNotification
-type EmailReceiver = original.EmailReceiver
-type EnableRequest = original.EnableRequest
-type ErrorResponse = original.ErrorResponse
-type EventCategoriesClient = original.EventCategoriesClient
-type EventCategoryCollection = original.EventCategoryCollection
-type EventData = original.EventData
-type EventDataCollection = original.EventDataCollection
-type EventDataCollectionIterator = original.EventDataCollectionIterator
-type EventDataCollectionPage = original.EventDataCollectionPage
-type HTTPRequestInfo = original.HTTPRequestInfo
-type Incident = original.Incident
-type IncidentListResult = original.IncidentListResult
-type ItsmReceiver = original.ItsmReceiver
-type LocalizableString = original.LocalizableString
-type LocationThresholdRuleCondition = original.LocationThresholdRuleCondition
-type LogProfileCollection = original.LogProfileCollection
-type LogProfileProperties = original.LogProfileProperties
-type LogProfileResource = original.LogProfileResource
-type LogProfileResourcePatch = original.LogProfileResourcePatch
-type LogProfilesClient = original.LogProfilesClient
-type LogSettings = original.LogSettings
-type ManagementEventAggregationCondition = original.ManagementEventAggregationCondition
-type ManagementEventRuleCondition = original.ManagementEventRuleCondition
-type MetadataValue = original.MetadataValue
-type Metric = original.Metric
-type MetricAvailability = original.MetricAvailability
-type MetricBaselineClient = original.MetricBaselineClient
-type MetricDefinition = original.MetricDefinition
-type MetricDefinitionCollection = original.MetricDefinitionCollection
-type MetricDefinitionsClient = original.MetricDefinitionsClient
-type MetricSettings = original.MetricSettings
-type MetricTrigger = original.MetricTrigger
-type MetricValue = original.MetricValue
-type MetricsClient = original.MetricsClient
-type Operation = original.Operation
-type OperationDisplay = original.OperationDisplay
-type OperationListResult = original.OperationListResult
-type OperationsClient = original.OperationsClient
-type ProxyOnlyResource = original.ProxyOnlyResource
-type Recurrence = original.Recurrence
-type RecurrentSchedule = original.RecurrentSchedule
-type Resource = original.Resource
-type Response = original.Response
-type RetentionPolicy = original.RetentionPolicy
-type RuleAction = original.RuleAction
-type RuleCondition = original.RuleCondition
-type RuleDataSource = original.RuleDataSource
-type RuleEmailAction = original.RuleEmailAction
-type RuleManagementEventClaimsDataSource = original.RuleManagementEventClaimsDataSource
-type RuleManagementEventDataSource = original.RuleManagementEventDataSource
-type RuleMetricDataSource = original.RuleMetricDataSource
-type RuleWebhookAction = original.RuleWebhookAction
-type ScaleAction = original.ScaleAction
-type ScaleCapacity = original.ScaleCapacity
-type ScaleRule = original.ScaleRule
-type SenderAuthorization = original.SenderAuthorization
-type SmsReceiver = original.SmsReceiver
-type TenantActivityLogsClient = original.TenantActivityLogsClient
-type ThresholdRuleCondition = original.ThresholdRuleCondition
-type TimeSeriesElement = original.TimeSeriesElement
-type TimeSeriesInformation = original.TimeSeriesInformation
-type TimeWindow = original.TimeWindow
-type VoiceReceiver = original.VoiceReceiver
-type WebhookNotification = original.WebhookNotification
-type WebhookReceiver = original.WebhookReceiver
-
-func New(subscriptionID string) BaseClient {
- return original.New(subscriptionID)
-}
-func NewActionGroupsClient(subscriptionID string) ActionGroupsClient {
- return original.NewActionGroupsClient(subscriptionID)
-}
-func NewActionGroupsClientWithBaseURI(baseURI string, subscriptionID string) ActionGroupsClient {
- return original.NewActionGroupsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewActivityLogAlertsClient(subscriptionID string) ActivityLogAlertsClient {
- return original.NewActivityLogAlertsClient(subscriptionID)
-}
-func NewActivityLogAlertsClientWithBaseURI(baseURI string, subscriptionID string) ActivityLogAlertsClient {
- return original.NewActivityLogAlertsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewActivityLogsClient(subscriptionID string) ActivityLogsClient {
- return original.NewActivityLogsClient(subscriptionID)
-}
-func NewActivityLogsClientWithBaseURI(baseURI string, subscriptionID string) ActivityLogsClient {
- return original.NewActivityLogsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewAlertRuleIncidentsClient(subscriptionID string) AlertRuleIncidentsClient {
- return original.NewAlertRuleIncidentsClient(subscriptionID)
-}
-func NewAlertRuleIncidentsClientWithBaseURI(baseURI string, subscriptionID string) AlertRuleIncidentsClient {
- return original.NewAlertRuleIncidentsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewAlertRulesClient(subscriptionID string) AlertRulesClient {
- return original.NewAlertRulesClient(subscriptionID)
-}
-func NewAlertRulesClientWithBaseURI(baseURI string, subscriptionID string) AlertRulesClient {
- return original.NewAlertRulesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewAutoscaleSettingsClient(subscriptionID string) AutoscaleSettingsClient {
- return original.NewAutoscaleSettingsClient(subscriptionID)
-}
-func NewAutoscaleSettingsClientWithBaseURI(baseURI string, subscriptionID string) AutoscaleSettingsClient {
- return original.NewAutoscaleSettingsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewDiagnosticSettingsCategoryClient(subscriptionID string) DiagnosticSettingsCategoryClient {
- return original.NewDiagnosticSettingsCategoryClient(subscriptionID)
-}
-func NewDiagnosticSettingsCategoryClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticSettingsCategoryClient {
- return original.NewDiagnosticSettingsCategoryClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewDiagnosticSettingsClient(subscriptionID string) DiagnosticSettingsClient {
- return original.NewDiagnosticSettingsClient(subscriptionID)
-}
-func NewDiagnosticSettingsClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticSettingsClient {
- return original.NewDiagnosticSettingsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewEventCategoriesClient(subscriptionID string) EventCategoriesClient {
- return original.NewEventCategoriesClient(subscriptionID)
-}
-func NewEventCategoriesClientWithBaseURI(baseURI string, subscriptionID string) EventCategoriesClient {
- return original.NewEventCategoriesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewLogProfilesClient(subscriptionID string) LogProfilesClient {
- return original.NewLogProfilesClient(subscriptionID)
-}
-func NewLogProfilesClientWithBaseURI(baseURI string, subscriptionID string) LogProfilesClient {
- return original.NewLogProfilesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewMetricBaselineClient(subscriptionID string) MetricBaselineClient {
- return original.NewMetricBaselineClient(subscriptionID)
-}
-func NewMetricBaselineClientWithBaseURI(baseURI string, subscriptionID string) MetricBaselineClient {
- return original.NewMetricBaselineClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewMetricDefinitionsClient(subscriptionID string) MetricDefinitionsClient {
- return original.NewMetricDefinitionsClient(subscriptionID)
-}
-func NewMetricDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) MetricDefinitionsClient {
- return original.NewMetricDefinitionsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewMetricsClient(subscriptionID string) MetricsClient {
- return original.NewMetricsClient(subscriptionID)
-}
-func NewMetricsClientWithBaseURI(baseURI string, subscriptionID string) MetricsClient {
- return original.NewMetricsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewOperationsClient(subscriptionID string) OperationsClient {
- return original.NewOperationsClient(subscriptionID)
-}
-func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
- return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewTenantActivityLogsClient(subscriptionID string) TenantActivityLogsClient {
- return original.NewTenantActivityLogsClient(subscriptionID)
-}
-func NewTenantActivityLogsClientWithBaseURI(baseURI string, subscriptionID string) TenantActivityLogsClient {
- return original.NewTenantActivityLogsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return original.NewWithBaseURI(baseURI, subscriptionID)
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/latest"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/preview/monitor/mgmt/insights/models.go b/profiles/preview/monitor/mgmt/insights/models.go
deleted file mode 100644
index 46cd1a6d4107..000000000000
--- a/profiles/preview/monitor/mgmt/insights/models.go
+++ /dev/null
@@ -1,415 +0,0 @@
-// +build go1.9
-
-// Copyright 2019 Microsoft Corporation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// This code was auto-generated by:
-// github.com/Azure/azure-sdk-for-go/tools/profileBuilder
-
-package insights
-
-import original "github.com/Azure/azure-sdk-for-go/services/monitor/mgmt/2017-09-01/insights"
-
-const (
- DefaultBaseURI = original.DefaultBaseURI
-)
-
-type AggregationType = original.AggregationType
-
-const (
- Average AggregationType = original.Average
- Count AggregationType = original.Count
- Maximum AggregationType = original.Maximum
- Minimum AggregationType = original.Minimum
- None AggregationType = original.None
- Total AggregationType = original.Total
-)
-
-type CategoryType = original.CategoryType
-
-const (
- Logs CategoryType = original.Logs
- Metrics CategoryType = original.Metrics
-)
-
-type ComparisonOperationType = original.ComparisonOperationType
-
-const (
- Equals ComparisonOperationType = original.Equals
- GreaterThan ComparisonOperationType = original.GreaterThan
- GreaterThanOrEqual ComparisonOperationType = original.GreaterThanOrEqual
- LessThan ComparisonOperationType = original.LessThan
- LessThanOrEqual ComparisonOperationType = original.LessThanOrEqual
- NotEquals ComparisonOperationType = original.NotEquals
-)
-
-type ConditionOperator = original.ConditionOperator
-
-const (
- ConditionOperatorGreaterThan ConditionOperator = original.ConditionOperatorGreaterThan
- ConditionOperatorGreaterThanOrEqual ConditionOperator = original.ConditionOperatorGreaterThanOrEqual
- ConditionOperatorLessThan ConditionOperator = original.ConditionOperatorLessThan
- ConditionOperatorLessThanOrEqual ConditionOperator = original.ConditionOperatorLessThanOrEqual
-)
-
-type EventLevel = original.EventLevel
-
-const (
- Critical EventLevel = original.Critical
- Error EventLevel = original.Error
- Informational EventLevel = original.Informational
- Verbose EventLevel = original.Verbose
- Warning EventLevel = original.Warning
-)
-
-type MetricStatisticType = original.MetricStatisticType
-
-const (
- MetricStatisticTypeAverage MetricStatisticType = original.MetricStatisticTypeAverage
- MetricStatisticTypeMax MetricStatisticType = original.MetricStatisticTypeMax
- MetricStatisticTypeMin MetricStatisticType = original.MetricStatisticTypeMin
- MetricStatisticTypeSum MetricStatisticType = original.MetricStatisticTypeSum
-)
-
-type OdataType = original.OdataType
-
-const (
- OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource OdataType = original.OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource
- OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource OdataType = original.OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource
- OdataTypeRuleDataSource OdataType = original.OdataTypeRuleDataSource
-)
-
-type OdataTypeBasicRuleAction = original.OdataTypeBasicRuleAction
-
-const (
- OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction OdataTypeBasicRuleAction = original.OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction
- OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction OdataTypeBasicRuleAction = original.OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction
- OdataTypeRuleAction OdataTypeBasicRuleAction = original.OdataTypeRuleAction
-)
-
-type OdataTypeBasicRuleCondition = original.OdataTypeBasicRuleCondition
-
-const (
- OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition OdataTypeBasicRuleCondition = original.OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition
- OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition OdataTypeBasicRuleCondition = original.OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition
- OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition OdataTypeBasicRuleCondition = original.OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition
- OdataTypeRuleCondition OdataTypeBasicRuleCondition = original.OdataTypeRuleCondition
-)
-
-type ReceiverStatus = original.ReceiverStatus
-
-const (
- Disabled ReceiverStatus = original.Disabled
- Enabled ReceiverStatus = original.Enabled
- NotSpecified ReceiverStatus = original.NotSpecified
-)
-
-type RecurrenceFrequency = original.RecurrenceFrequency
-
-const (
- RecurrenceFrequencyDay RecurrenceFrequency = original.RecurrenceFrequencyDay
- RecurrenceFrequencyHour RecurrenceFrequency = original.RecurrenceFrequencyHour
- RecurrenceFrequencyMinute RecurrenceFrequency = original.RecurrenceFrequencyMinute
- RecurrenceFrequencyMonth RecurrenceFrequency = original.RecurrenceFrequencyMonth
- RecurrenceFrequencyNone RecurrenceFrequency = original.RecurrenceFrequencyNone
- RecurrenceFrequencySecond RecurrenceFrequency = original.RecurrenceFrequencySecond
- RecurrenceFrequencyWeek RecurrenceFrequency = original.RecurrenceFrequencyWeek
- RecurrenceFrequencyYear RecurrenceFrequency = original.RecurrenceFrequencyYear
-)
-
-type ResultType = original.ResultType
-
-const (
- Data ResultType = original.Data
- Metadata ResultType = original.Metadata
-)
-
-type ScaleDirection = original.ScaleDirection
-
-const (
- ScaleDirectionDecrease ScaleDirection = original.ScaleDirectionDecrease
- ScaleDirectionIncrease ScaleDirection = original.ScaleDirectionIncrease
- ScaleDirectionNone ScaleDirection = original.ScaleDirectionNone
-)
-
-type ScaleType = original.ScaleType
-
-const (
- ChangeCount ScaleType = original.ChangeCount
- ExactCount ScaleType = original.ExactCount
- PercentChangeCount ScaleType = original.PercentChangeCount
-)
-
-type Sensitivity = original.Sensitivity
-
-const (
- High Sensitivity = original.High
- Low Sensitivity = original.Low
- Medium Sensitivity = original.Medium
-)
-
-type TimeAggregationOperator = original.TimeAggregationOperator
-
-const (
- TimeAggregationOperatorAverage TimeAggregationOperator = original.TimeAggregationOperatorAverage
- TimeAggregationOperatorLast TimeAggregationOperator = original.TimeAggregationOperatorLast
- TimeAggregationOperatorMaximum TimeAggregationOperator = original.TimeAggregationOperatorMaximum
- TimeAggregationOperatorMinimum TimeAggregationOperator = original.TimeAggregationOperatorMinimum
- TimeAggregationOperatorTotal TimeAggregationOperator = original.TimeAggregationOperatorTotal
-)
-
-type TimeAggregationType = original.TimeAggregationType
-
-const (
- TimeAggregationTypeAverage TimeAggregationType = original.TimeAggregationTypeAverage
- TimeAggregationTypeCount TimeAggregationType = original.TimeAggregationTypeCount
- TimeAggregationTypeMaximum TimeAggregationType = original.TimeAggregationTypeMaximum
- TimeAggregationTypeMinimum TimeAggregationType = original.TimeAggregationTypeMinimum
- TimeAggregationTypeTotal TimeAggregationType = original.TimeAggregationTypeTotal
-)
-
-type Unit = original.Unit
-
-const (
- UnitBytes Unit = original.UnitBytes
- UnitByteSeconds Unit = original.UnitByteSeconds
- UnitBytesPerSecond Unit = original.UnitBytesPerSecond
- UnitCount Unit = original.UnitCount
- UnitCountPerSecond Unit = original.UnitCountPerSecond
- UnitMilliSeconds Unit = original.UnitMilliSeconds
- UnitPercent Unit = original.UnitPercent
- UnitSeconds Unit = original.UnitSeconds
- UnitUnspecified Unit = original.UnitUnspecified
-)
-
-type ActionGroup = original.ActionGroup
-type ActionGroupList = original.ActionGroupList
-type ActionGroupPatch = original.ActionGroupPatch
-type ActionGroupPatchBody = original.ActionGroupPatchBody
-type ActionGroupResource = original.ActionGroupResource
-type ActionGroupsClient = original.ActionGroupsClient
-type ActivityLogAlert = original.ActivityLogAlert
-type ActivityLogAlertActionGroup = original.ActivityLogAlertActionGroup
-type ActivityLogAlertActionList = original.ActivityLogAlertActionList
-type ActivityLogAlertAllOfCondition = original.ActivityLogAlertAllOfCondition
-type ActivityLogAlertLeafCondition = original.ActivityLogAlertLeafCondition
-type ActivityLogAlertList = original.ActivityLogAlertList
-type ActivityLogAlertPatch = original.ActivityLogAlertPatch
-type ActivityLogAlertPatchBody = original.ActivityLogAlertPatchBody
-type ActivityLogAlertResource = original.ActivityLogAlertResource
-type ActivityLogAlertsClient = original.ActivityLogAlertsClient
-type ActivityLogsClient = original.ActivityLogsClient
-type AlertRule = original.AlertRule
-type AlertRuleIncidentsClient = original.AlertRuleIncidentsClient
-type AlertRuleResource = original.AlertRuleResource
-type AlertRuleResourceCollection = original.AlertRuleResourceCollection
-type AlertRuleResourcePatch = original.AlertRuleResourcePatch
-type AlertRulesClient = original.AlertRulesClient
-type AutomationRunbookReceiver = original.AutomationRunbookReceiver
-type AutoscaleNotification = original.AutoscaleNotification
-type AutoscaleProfile = original.AutoscaleProfile
-type AutoscaleSetting = original.AutoscaleSetting
-type AutoscaleSettingResource = original.AutoscaleSettingResource
-type AutoscaleSettingResourceCollection = original.AutoscaleSettingResourceCollection
-type AutoscaleSettingResourceCollectionIterator = original.AutoscaleSettingResourceCollectionIterator
-type AutoscaleSettingResourceCollectionPage = original.AutoscaleSettingResourceCollectionPage
-type AutoscaleSettingResourcePatch = original.AutoscaleSettingResourcePatch
-type AutoscaleSettingsClient = original.AutoscaleSettingsClient
-type AzureAppPushReceiver = original.AzureAppPushReceiver
-type BaseClient = original.BaseClient
-type Baseline = original.Baseline
-type BaselineMetadataValue = original.BaselineMetadataValue
-type BaselineProperties = original.BaselineProperties
-type BaselineResponse = original.BaselineResponse
-type BasicRuleAction = original.BasicRuleAction
-type BasicRuleCondition = original.BasicRuleCondition
-type BasicRuleDataSource = original.BasicRuleDataSource
-type CalculateBaselineResponse = original.CalculateBaselineResponse
-type DiagnosticSettings = original.DiagnosticSettings
-type DiagnosticSettingsCategory = original.DiagnosticSettingsCategory
-type DiagnosticSettingsCategoryClient = original.DiagnosticSettingsCategoryClient
-type DiagnosticSettingsCategoryResource = original.DiagnosticSettingsCategoryResource
-type DiagnosticSettingsCategoryResourceCollection = original.DiagnosticSettingsCategoryResourceCollection
-type DiagnosticSettingsClient = original.DiagnosticSettingsClient
-type DiagnosticSettingsResource = original.DiagnosticSettingsResource
-type DiagnosticSettingsResourceCollection = original.DiagnosticSettingsResourceCollection
-type EmailNotification = original.EmailNotification
-type EmailReceiver = original.EmailReceiver
-type EnableRequest = original.EnableRequest
-type ErrorResponse = original.ErrorResponse
-type EventCategoriesClient = original.EventCategoriesClient
-type EventCategoryCollection = original.EventCategoryCollection
-type EventData = original.EventData
-type EventDataCollection = original.EventDataCollection
-type EventDataCollectionIterator = original.EventDataCollectionIterator
-type EventDataCollectionPage = original.EventDataCollectionPage
-type HTTPRequestInfo = original.HTTPRequestInfo
-type Incident = original.Incident
-type IncidentListResult = original.IncidentListResult
-type ItsmReceiver = original.ItsmReceiver
-type LocalizableString = original.LocalizableString
-type LocationThresholdRuleCondition = original.LocationThresholdRuleCondition
-type LogProfileCollection = original.LogProfileCollection
-type LogProfileProperties = original.LogProfileProperties
-type LogProfileResource = original.LogProfileResource
-type LogProfileResourcePatch = original.LogProfileResourcePatch
-type LogProfilesClient = original.LogProfilesClient
-type LogSettings = original.LogSettings
-type ManagementEventAggregationCondition = original.ManagementEventAggregationCondition
-type ManagementEventRuleCondition = original.ManagementEventRuleCondition
-type MetadataValue = original.MetadataValue
-type Metric = original.Metric
-type MetricAvailability = original.MetricAvailability
-type MetricBaselineClient = original.MetricBaselineClient
-type MetricDefinition = original.MetricDefinition
-type MetricDefinitionCollection = original.MetricDefinitionCollection
-type MetricDefinitionsClient = original.MetricDefinitionsClient
-type MetricSettings = original.MetricSettings
-type MetricTrigger = original.MetricTrigger
-type MetricValue = original.MetricValue
-type MetricsClient = original.MetricsClient
-type Operation = original.Operation
-type OperationDisplay = original.OperationDisplay
-type OperationListResult = original.OperationListResult
-type OperationsClient = original.OperationsClient
-type ProxyOnlyResource = original.ProxyOnlyResource
-type Recurrence = original.Recurrence
-type RecurrentSchedule = original.RecurrentSchedule
-type Resource = original.Resource
-type Response = original.Response
-type RetentionPolicy = original.RetentionPolicy
-type RuleAction = original.RuleAction
-type RuleCondition = original.RuleCondition
-type RuleDataSource = original.RuleDataSource
-type RuleEmailAction = original.RuleEmailAction
-type RuleManagementEventClaimsDataSource = original.RuleManagementEventClaimsDataSource
-type RuleManagementEventDataSource = original.RuleManagementEventDataSource
-type RuleMetricDataSource = original.RuleMetricDataSource
-type RuleWebhookAction = original.RuleWebhookAction
-type ScaleAction = original.ScaleAction
-type ScaleCapacity = original.ScaleCapacity
-type ScaleRule = original.ScaleRule
-type SenderAuthorization = original.SenderAuthorization
-type SmsReceiver = original.SmsReceiver
-type TenantActivityLogsClient = original.TenantActivityLogsClient
-type ThresholdRuleCondition = original.ThresholdRuleCondition
-type TimeSeriesElement = original.TimeSeriesElement
-type TimeSeriesInformation = original.TimeSeriesInformation
-type TimeWindow = original.TimeWindow
-type VoiceReceiver = original.VoiceReceiver
-type WebhookNotification = original.WebhookNotification
-type WebhookReceiver = original.WebhookReceiver
-
-func New(subscriptionID string) BaseClient {
- return original.New(subscriptionID)
-}
-func NewActionGroupsClient(subscriptionID string) ActionGroupsClient {
- return original.NewActionGroupsClient(subscriptionID)
-}
-func NewActionGroupsClientWithBaseURI(baseURI string, subscriptionID string) ActionGroupsClient {
- return original.NewActionGroupsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewActivityLogAlertsClient(subscriptionID string) ActivityLogAlertsClient {
- return original.NewActivityLogAlertsClient(subscriptionID)
-}
-func NewActivityLogAlertsClientWithBaseURI(baseURI string, subscriptionID string) ActivityLogAlertsClient {
- return original.NewActivityLogAlertsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewActivityLogsClient(subscriptionID string) ActivityLogsClient {
- return original.NewActivityLogsClient(subscriptionID)
-}
-func NewActivityLogsClientWithBaseURI(baseURI string, subscriptionID string) ActivityLogsClient {
- return original.NewActivityLogsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewAlertRuleIncidentsClient(subscriptionID string) AlertRuleIncidentsClient {
- return original.NewAlertRuleIncidentsClient(subscriptionID)
-}
-func NewAlertRuleIncidentsClientWithBaseURI(baseURI string, subscriptionID string) AlertRuleIncidentsClient {
- return original.NewAlertRuleIncidentsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewAlertRulesClient(subscriptionID string) AlertRulesClient {
- return original.NewAlertRulesClient(subscriptionID)
-}
-func NewAlertRulesClientWithBaseURI(baseURI string, subscriptionID string) AlertRulesClient {
- return original.NewAlertRulesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewAutoscaleSettingsClient(subscriptionID string) AutoscaleSettingsClient {
- return original.NewAutoscaleSettingsClient(subscriptionID)
-}
-func NewAutoscaleSettingsClientWithBaseURI(baseURI string, subscriptionID string) AutoscaleSettingsClient {
- return original.NewAutoscaleSettingsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewDiagnosticSettingsCategoryClient(subscriptionID string) DiagnosticSettingsCategoryClient {
- return original.NewDiagnosticSettingsCategoryClient(subscriptionID)
-}
-func NewDiagnosticSettingsCategoryClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticSettingsCategoryClient {
- return original.NewDiagnosticSettingsCategoryClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewDiagnosticSettingsClient(subscriptionID string) DiagnosticSettingsClient {
- return original.NewDiagnosticSettingsClient(subscriptionID)
-}
-func NewDiagnosticSettingsClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticSettingsClient {
- return original.NewDiagnosticSettingsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewEventCategoriesClient(subscriptionID string) EventCategoriesClient {
- return original.NewEventCategoriesClient(subscriptionID)
-}
-func NewEventCategoriesClientWithBaseURI(baseURI string, subscriptionID string) EventCategoriesClient {
- return original.NewEventCategoriesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewLogProfilesClient(subscriptionID string) LogProfilesClient {
- return original.NewLogProfilesClient(subscriptionID)
-}
-func NewLogProfilesClientWithBaseURI(baseURI string, subscriptionID string) LogProfilesClient {
- return original.NewLogProfilesClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewMetricBaselineClient(subscriptionID string) MetricBaselineClient {
- return original.NewMetricBaselineClient(subscriptionID)
-}
-func NewMetricBaselineClientWithBaseURI(baseURI string, subscriptionID string) MetricBaselineClient {
- return original.NewMetricBaselineClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewMetricDefinitionsClient(subscriptionID string) MetricDefinitionsClient {
- return original.NewMetricDefinitionsClient(subscriptionID)
-}
-func NewMetricDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) MetricDefinitionsClient {
- return original.NewMetricDefinitionsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewMetricsClient(subscriptionID string) MetricsClient {
- return original.NewMetricsClient(subscriptionID)
-}
-func NewMetricsClientWithBaseURI(baseURI string, subscriptionID string) MetricsClient {
- return original.NewMetricsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewOperationsClient(subscriptionID string) OperationsClient {
- return original.NewOperationsClient(subscriptionID)
-}
-func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
- return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewTenantActivityLogsClient(subscriptionID string) TenantActivityLogsClient {
- return original.NewTenantActivityLogsClient(subscriptionID)
-}
-func NewTenantActivityLogsClientWithBaseURI(baseURI string, subscriptionID string) TenantActivityLogsClient {
- return original.NewTenantActivityLogsClientWithBaseURI(baseURI, subscriptionID)
-}
-func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
- return original.NewWithBaseURI(baseURI, subscriptionID)
-}
-func UserAgent() string {
- return original.UserAgent() + " profiles/preview"
-}
-func Version() string {
- return original.Version()
-}
diff --git a/profiles/preview/preview/monitor/mgmt/insights/insightsapi/models.go b/profiles/preview/preview/monitor/mgmt/insights/insightsapi/models.go
index c0f3e40c794b..fb8644eb2b9f 100644
--- a/profiles/preview/preview/monitor/mgmt/insights/insightsapi/models.go
+++ b/profiles/preview/preview/monitor/mgmt/insights/insightsapi/models.go
@@ -19,7 +19,7 @@
package insightsapi
-import original "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-09-01/insights/insightsapi"
+import original "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-11-01-preview/insights/insightsapi"
type ActionGroupsClientAPI = original.ActionGroupsClientAPI
type ActivityLogAlertsClientAPI = original.ActivityLogAlertsClientAPI
@@ -40,3 +40,4 @@ type MetricsClientAPI = original.MetricsClientAPI
type OperationsClientAPI = original.OperationsClientAPI
type ScheduledQueryRulesClientAPI = original.ScheduledQueryRulesClientAPI
type TenantActivityLogsClientAPI = original.TenantActivityLogsClientAPI
+type VMInsightsClientAPI = original.VMInsightsClientAPI
diff --git a/profiles/preview/preview/monitor/mgmt/insights/models.go b/profiles/preview/preview/monitor/mgmt/insights/models.go
index 79898aba7a1c..4ba583c37b67 100644
--- a/profiles/preview/preview/monitor/mgmt/insights/models.go
+++ b/profiles/preview/preview/monitor/mgmt/insights/models.go
@@ -22,7 +22,7 @@ package insights
import (
"context"
- original "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-09-01/insights"
+ original "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-11-01-preview/insights"
)
const (
@@ -92,6 +92,13 @@ const (
CriterionTypeStaticThresholdCriterion CriterionType = original.CriterionTypeStaticThresholdCriterion
)
+type DataStatus = original.DataStatus
+
+const (
+ NotPresent DataStatus = original.NotPresent
+ Present DataStatus = original.Present
+)
+
type Enabled = original.Enabled
const (
@@ -102,11 +109,11 @@ const (
type EventLevel = original.EventLevel
const (
- Critical EventLevel = original.Critical
- Error EventLevel = original.Error
- Informational EventLevel = original.Informational
- Verbose EventLevel = original.Verbose
- Warning EventLevel = original.Warning
+ EventLevelCritical EventLevel = original.EventLevelCritical
+ EventLevelError EventLevel = original.EventLevelError
+ EventLevelInformational EventLevel = original.EventLevelInformational
+ EventLevelVerbose EventLevel = original.EventLevelVerbose
+ EventLevelWarning EventLevel = original.EventLevelWarning
)
type MetricStatisticType = original.MetricStatisticType
@@ -166,6 +173,14 @@ const (
OdataTypeRuleCondition OdataTypeBasicRuleCondition = original.OdataTypeRuleCondition
)
+type OnboardingStatus = original.OnboardingStatus
+
+const (
+ NotOnboarded OnboardingStatus = original.NotOnboarded
+ Onboarded OnboardingStatus = original.Onboarded
+ Unknown OnboardingStatus = original.Unknown
+)
+
type ProvisioningState = original.ProvisioningState
const (
@@ -320,6 +335,7 @@ type BasicRuleCondition = original.BasicRuleCondition
type BasicRuleDataSource = original.BasicRuleDataSource
type CalculateBaselineResponse = original.CalculateBaselineResponse
type Criteria = original.Criteria
+type DataContainer = original.DataContainer
type DiagnosticSettings = original.DiagnosticSettings
type DiagnosticSettingsCategory = original.DiagnosticSettingsCategory
type DiagnosticSettingsCategoryClient = original.DiagnosticSettingsCategoryClient
@@ -332,6 +348,7 @@ type Dimension = original.Dimension
type EmailNotification = original.EmailNotification
type EmailReceiver = original.EmailReceiver
type EnableRequest = original.EnableRequest
+type Error = original.Error
type ErrorResponse = original.ErrorResponse
type EventCategoriesClient = original.EventCategoriesClient
type EventCategoryCollection = original.EventCategoryCollection
@@ -397,10 +414,12 @@ type OperationDisplay = original.OperationDisplay
type OperationListResult = original.OperationListResult
type OperationsClient = original.OperationsClient
type ProxyOnlyResource = original.ProxyOnlyResource
+type ProxyResource = original.ProxyResource
type Recurrence = original.Recurrence
type RecurrentSchedule = original.RecurrentSchedule
type Resource = original.Resource
type Response = original.Response
+type ResponseWithError = original.ResponseWithError
type RetentionPolicy = original.RetentionPolicy
type RuleAction = original.RuleAction
type RuleCondition = original.RuleCondition
@@ -424,9 +443,14 @@ type TimeSeriesElement = original.TimeSeriesElement
type TimeSeriesInformation = original.TimeSeriesInformation
type TimeWindow = original.TimeWindow
type TriggerCondition = original.TriggerCondition
+type VMInsightsClient = original.VMInsightsClient
+type VMInsightsOnboardingStatus = original.VMInsightsOnboardingStatus
+type VMInsightsOnboardingStatusProperties = original.VMInsightsOnboardingStatusProperties
type VoiceReceiver = original.VoiceReceiver
type WebhookNotification = original.WebhookNotification
type WebhookReceiver = original.WebhookReceiver
+type WorkspaceInfo = original.WorkspaceInfo
+type WorkspaceInfoProperties = original.WorkspaceInfoProperties
func New(subscriptionID string) BaseClient {
return original.New(subscriptionID)
@@ -557,6 +581,12 @@ func NewTenantActivityLogsClient(subscriptionID string) TenantActivityLogsClient
func NewTenantActivityLogsClientWithBaseURI(baseURI string, subscriptionID string) TenantActivityLogsClient {
return original.NewTenantActivityLogsClientWithBaseURI(baseURI, subscriptionID)
}
+func NewVMInsightsClient(subscriptionID string) VMInsightsClient {
+ return original.NewVMInsightsClient(subscriptionID)
+}
+func NewVMInsightsClientWithBaseURI(baseURI string, subscriptionID string) VMInsightsClient {
+ return original.NewVMInsightsClientWithBaseURI(baseURI, subscriptionID)
+}
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
return original.NewWithBaseURI(baseURI, subscriptionID)
}
@@ -581,6 +611,9 @@ func PossibleConditionalOperatorValues() []ConditionalOperator {
func PossibleCriterionTypeValues() []CriterionType {
return original.PossibleCriterionTypeValues()
}
+func PossibleDataStatusValues() []DataStatus {
+ return original.PossibleDataStatusValues()
+}
func PossibleEnabledValues() []Enabled {
return original.PossibleEnabledValues()
}
@@ -608,6 +641,9 @@ func PossibleOdataTypeBasicRuleConditionValues() []OdataTypeBasicRuleCondition {
func PossibleOdataTypeValues() []OdataType {
return original.PossibleOdataTypeValues()
}
+func PossibleOnboardingStatusValues() []OnboardingStatus {
+ return original.PossibleOnboardingStatusValues()
+}
func PossibleProvisioningStateValues() []ProvisioningState {
return original.PossibleProvisioningStateValues()
}
diff --git a/services/monitor/mgmt/2017-09-01/insights/activitylogs.go b/services/preview/monitor/mgmt/2017-05-01-preview/insights/activitylogs.go
similarity index 71%
rename from services/monitor/mgmt/2017-09-01/insights/activitylogs.go
rename to services/preview/monitor/mgmt/2017-05-01-preview/insights/activitylogs.go
index 9c77eca5114b..92120d847dce 100644
--- a/services/monitor/mgmt/2017-09-01/insights/activitylogs.go
+++ b/services/preview/monitor/mgmt/2017-05-01-preview/insights/activitylogs.go
@@ -21,6 +21,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -40,23 +41,35 @@ func NewActivityLogsClientWithBaseURI(baseURI string, subscriptionID string) Act
}
// List provides the list of records from the activity logs.
-//
-// filter is reduces the set of data collected.
The **$filter** argument is very restricted and allows only the
-// following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge
+// Parameters:
+// filter - reduces the set of data collected.
The **$filter** argument is very restricted and allows only
+// the following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge
// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq
-// 'resourceGroupName'.
- *List events for resource*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z'
-// and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq 'resourceURI'.
- *List events for a
-// subscription in a time range*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le
-// '2014-07-20T04:36:37.6407898Z'.
- *List events for a resource provider*: $filter=eventTimestamp ge
-// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq
-// 'resourceProviderName'.
- *List events for a correlation Id*: $filter=eventTimestamp ge
-// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq
-// 'correlationID'.
**NOTE**: No other syntax is allowed. selectParameter is used to fetch events with only
-// the given properties.
The **$select** argument is a comma separated list of property names to be returned.
-// Possible values are: *authorization*, *claims*, *correlationId*, *description*, *eventDataId*, *eventName*,
-// *eventTimestamp*, *httpRequest*, *level*, *operationId*, *operationName*, *properties*, *resourceGroupName*,
-// *resourceProviderName*, *resourceId*, *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*
+// 'resourceGroupName'.
- *List events for resource*: $filter=eventTimestamp ge
+// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq
+// 'resourceURI'.
- *List events for a subscription in a time range*: $filter=eventTimestamp ge
+// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List events for a
+// resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le
+// '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.
- *List events for a
+// correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le
+// '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.
**NOTE**: No other syntax is
+// allowed.
+// selectParameter - used to fetch events with only the given properties.
The **$select** argument is a
+// comma separated list of property names to be returned. Possible values are: *authorization*, *claims*,
+// *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*,
+// *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*,
+// *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*
func (client ActivityLogsClient) List(ctx context.Context, filter string, selectParameter string) (result EventDataCollectionPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActivityLogsClient.List")
+ defer func() {
+ sc := -1
+ if result.edc.Response.Response != nil {
+ sc = result.edc.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, filter, selectParameter)
if err != nil {
@@ -125,8 +138,8 @@ func (client ActivityLogsClient) ListResponder(resp *http.Response) (result Even
}
// listNextResults retrieves the next set of results, if any.
-func (client ActivityLogsClient) listNextResults(lastResults EventDataCollection) (result EventDataCollection, err error) {
- req, err := lastResults.eventDataCollectionPreparer()
+func (client ActivityLogsClient) listNextResults(ctx context.Context, lastResults EventDataCollection) (result EventDataCollection, err error) {
+ req, err := lastResults.eventDataCollectionPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "insights.ActivityLogsClient", "listNextResults", nil, "Failure preparing next results request")
}
@@ -147,6 +160,16 @@ func (client ActivityLogsClient) listNextResults(lastResults EventDataCollection
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client ActivityLogsClient) ListComplete(ctx context.Context, filter string, selectParameter string) (result EventDataCollectionIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActivityLogsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
result.page, err = client.List(ctx, filter, selectParameter)
return
}
diff --git a/services/preview/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettings.go b/services/preview/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettings.go
index 3e9bf130f72d..441f65a391a1 100644
--- a/services/preview/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettings.go
+++ b/services/preview/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettings.go
@@ -81,7 +81,7 @@ func (client DiagnosticSettingsClient) CreateOrUpdate(ctx context.Context, resou
func (client DiagnosticSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceURI string, parameters DiagnosticSettingsResource, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"name": autorest.Encode("path", name),
- "resourceUri": autorest.Encode("path", resourceURI),
+ "resourceUri": resourceURI,
}
const APIVersion = "2017-05-01-preview"
@@ -159,7 +159,7 @@ func (client DiagnosticSettingsClient) Delete(ctx context.Context, resourceURI s
func (client DiagnosticSettingsClient) DeletePreparer(ctx context.Context, resourceURI string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"name": autorest.Encode("path", name),
- "resourceUri": autorest.Encode("path", resourceURI),
+ "resourceUri": resourceURI,
}
const APIVersion = "2017-05-01-preview"
@@ -234,7 +234,7 @@ func (client DiagnosticSettingsClient) Get(ctx context.Context, resourceURI stri
func (client DiagnosticSettingsClient) GetPreparer(ctx context.Context, resourceURI string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"name": autorest.Encode("path", name),
- "resourceUri": autorest.Encode("path", resourceURI),
+ "resourceUri": resourceURI,
}
const APIVersion = "2017-05-01-preview"
@@ -308,7 +308,7 @@ func (client DiagnosticSettingsClient) List(ctx context.Context, resourceURI str
// ListPreparer prepares the List request.
func (client DiagnosticSettingsClient) ListPreparer(ctx context.Context, resourceURI string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceUri": autorest.Encode("path", resourceURI),
+ "resourceUri": resourceURI,
}
const APIVersion = "2017-05-01-preview"
diff --git a/services/preview/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettingscategory.go b/services/preview/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettingscategory.go
index 9fbbb7ff6ab8..724253f35b7e 100644
--- a/services/preview/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettingscategory.go
+++ b/services/preview/monitor/mgmt/2017-05-01-preview/insights/diagnosticsettingscategory.go
@@ -80,7 +80,7 @@ func (client DiagnosticSettingsCategoryClient) Get(ctx context.Context, resource
func (client DiagnosticSettingsCategoryClient) GetPreparer(ctx context.Context, resourceURI string, name string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"name": autorest.Encode("path", name),
- "resourceUri": autorest.Encode("path", resourceURI),
+ "resourceUri": resourceURI,
}
const APIVersion = "2017-05-01-preview"
@@ -154,7 +154,7 @@ func (client DiagnosticSettingsCategoryClient) List(ctx context.Context, resourc
// ListPreparer prepares the List request.
func (client DiagnosticSettingsCategoryClient) ListPreparer(ctx context.Context, resourceURI string) (*http.Request, error) {
pathParameters := map[string]interface{}{
- "resourceUri": autorest.Encode("path", resourceURI),
+ "resourceUri": resourceURI,
}
const APIVersion = "2017-05-01-preview"
diff --git a/services/monitor/mgmt/2017-09-01/insights/eventcategories.go b/services/preview/monitor/mgmt/2017-05-01-preview/insights/eventcategories.go
similarity index 92%
rename from services/monitor/mgmt/2017-09-01/insights/eventcategories.go
rename to services/preview/monitor/mgmt/2017-05-01-preview/insights/eventcategories.go
index fe2200db92cf..ed5854d8f49a 100644
--- a/services/monitor/mgmt/2017-09-01/insights/eventcategories.go
+++ b/services/preview/monitor/mgmt/2017-05-01-preview/insights/eventcategories.go
@@ -21,6 +21,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -42,6 +43,16 @@ func NewEventCategoriesClientWithBaseURI(baseURI string, subscriptionID string)
// List get the list of available event categories supported in the Activity Logs Service.
The current list includes
// the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy.
func (client EventCategoriesClient) List(ctx context.Context) (result EventCategoryCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/EventCategoriesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.EventCategoriesClient", "List", nil, "Failure preparing request")
diff --git a/services/preview/monitor/mgmt/2017-05-01-preview/insights/insightsapi/interfaces.go b/services/preview/monitor/mgmt/2017-05-01-preview/insights/insightsapi/interfaces.go
index 59cd09b1e3d4..3393f697f13d 100644
--- a/services/preview/monitor/mgmt/2017-05-01-preview/insights/insightsapi/interfaces.go
+++ b/services/preview/monitor/mgmt/2017-05-01-preview/insights/insightsapi/interfaces.go
@@ -115,3 +115,46 @@ type ActivityLogAlertsClientAPI interface {
}
var _ ActivityLogAlertsClientAPI = (*insights.ActivityLogAlertsClient)(nil)
+
+// ActivityLogsClientAPI contains the set of methods on the ActivityLogsClient type.
+type ActivityLogsClientAPI interface {
+ List(ctx context.Context, filter string, selectParameter string) (result insights.EventDataCollectionPage, err error)
+}
+
+var _ ActivityLogsClientAPI = (*insights.ActivityLogsClient)(nil)
+
+// EventCategoriesClientAPI contains the set of methods on the EventCategoriesClient type.
+type EventCategoriesClientAPI interface {
+ List(ctx context.Context) (result insights.EventCategoryCollection, err error)
+}
+
+var _ EventCategoriesClientAPI = (*insights.EventCategoriesClient)(nil)
+
+// TenantActivityLogsClientAPI contains the set of methods on the TenantActivityLogsClient type.
+type TenantActivityLogsClientAPI interface {
+ List(ctx context.Context, filter string, selectParameter string) (result insights.EventDataCollectionPage, err error)
+}
+
+var _ TenantActivityLogsClientAPI = (*insights.TenantActivityLogsClient)(nil)
+
+// MetricDefinitionsClientAPI contains the set of methods on the MetricDefinitionsClient type.
+type MetricDefinitionsClientAPI interface {
+ List(ctx context.Context, resourceURI string) (result insights.MetricDefinitionCollection, err error)
+}
+
+var _ MetricDefinitionsClientAPI = (*insights.MetricDefinitionsClient)(nil)
+
+// MetricsClientAPI contains the set of methods on the MetricsClient type.
+type MetricsClientAPI interface {
+ List(ctx context.Context, resourceURI string, timespan string, interval *string, metric string, aggregation string, top *float64, orderby string, filter string, resultType insights.ResultType) (result insights.Response, err error)
+}
+
+var _ MetricsClientAPI = (*insights.MetricsClient)(nil)
+
+// MetricBaselineClientAPI contains the set of methods on the MetricBaselineClient type.
+type MetricBaselineClientAPI interface {
+ CalculateBaseline(ctx context.Context, resourceURI string, timeSeriesInformation insights.TimeSeriesInformation) (result insights.CalculateBaselineResponse, err error)
+ Get(ctx context.Context, resourceURI string, metricName string, timespan string, interval *string, aggregation string, sensitivities string, resultType insights.ResultType) (result insights.BaselineResponse, err error)
+}
+
+var _ MetricBaselineClientAPI = (*insights.MetricBaselineClient)(nil)
diff --git a/services/monitor/mgmt/2017-09-01/insights/metricbaseline.go b/services/preview/monitor/mgmt/2017-05-01-preview/insights/metricbaseline.go
similarity index 84%
rename from services/monitor/mgmt/2017-09-01/insights/metricbaseline.go
rename to services/preview/monitor/mgmt/2017-05-01-preview/insights/metricbaseline.go
index 3e812be44903..43042eacb376 100644
--- a/services/monitor/mgmt/2017-09-01/insights/metricbaseline.go
+++ b/services/preview/monitor/mgmt/2017-05-01-preview/insights/metricbaseline.go
@@ -22,6 +22,7 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -41,13 +42,23 @@ func NewMetricBaselineClientWithBaseURI(baseURI string, subscriptionID string) M
}
// CalculateBaseline **Lists the baseline values for a resource**.
-//
-// resourceURI is the identifier of the resource. It has the following structure:
-// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. For
-// example:
+// Parameters:
+// resourceURI - the identifier of the resource. It has the following structure:
+// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
+// For example:
// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
-// timeSeriesInformation is information that need to be specified to calculate a baseline on a time series.
+// timeSeriesInformation - information that need to be specified to calculate a baseline on a time series.
func (client MetricBaselineClient) CalculateBaseline(ctx context.Context, resourceURI string, timeSeriesInformation TimeSeriesInformation) (result CalculateBaselineResponse, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricBaselineClient.CalculateBaseline")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
if err := validation.Validate([]validation.Validation{
{TargetValue: timeSeriesInformation,
Constraints: []validation.Constraint{{Target: "timeSeriesInformation.Sensitivities", Name: validation.Null, Rule: true, Chain: nil},
@@ -88,7 +99,7 @@ func (client MetricBaselineClient) CalculateBaselinePreparer(ctx context.Context
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/{resourceUri}/providers/microsoft.insights/calculatebaseline", pathParameters),
@@ -118,17 +129,29 @@ func (client MetricBaselineClient) CalculateBaselineResponder(resp *http.Respons
}
// Get **Gets the baseline values for a specific metric**.
-//
-// resourceURI is the identifier of the resource. It has the following structure:
-// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}. For
-// example:
+// Parameters:
+// resourceURI - the identifier of the resource. It has the following structure:
+// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
+// For example:
// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
-// metricName is the name of the metric to retrieve the baseline for. timespan is the timespan of the query. It is
-// a string with the following format 'startDateTime_ISO/endDateTime_ISO'. interval is the interval (i.e.
-// timegrain) of the query. aggregation is the aggregation type of the metric to retrieve the baseline for.
-// sensitivities is the list of sensitivities (comma separated) to retrieve. resultType is allows retrieving only
-// metadata of the baseline. On data request all information is retrieved.
+// metricName - the name of the metric to retrieve the baseline for.
+// timespan - the timespan of the query. It is a string with the following format
+// 'startDateTime_ISO/endDateTime_ISO'.
+// interval - the interval (i.e. timegrain) of the query.
+// aggregation - the aggregation type of the metric to retrieve the baseline for.
+// sensitivities - the list of sensitivities (comma separated) to retrieve.
+// resultType - allows retrieving only metadata of the baseline. On data request all information is retrieved.
func (client MetricBaselineClient) Get(ctx context.Context, resourceURI string, metricName string, timespan string, interval *string, aggregation string, sensitivities string, resultType ResultType) (result BaselineResponse, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricBaselineClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.GetPreparer(ctx, resourceURI, metricName, timespan, interval, aggregation, sensitivities, resultType)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.MetricBaselineClient", "Get", nil, "Failure preparing request")
diff --git a/services/monitor/mgmt/2017-09-01/insights/metricdefinitions.go b/services/preview/monitor/mgmt/2017-05-01-preview/insights/metricdefinitions.go
similarity index 91%
rename from services/monitor/mgmt/2017-09-01/insights/metricdefinitions.go
rename to services/preview/monitor/mgmt/2017-05-01-preview/insights/metricdefinitions.go
index bcb023ded893..341b60212cdd 100644
--- a/services/monitor/mgmt/2017-09-01/insights/metricdefinitions.go
+++ b/services/preview/monitor/mgmt/2017-05-01-preview/insights/metricdefinitions.go
@@ -21,6 +21,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -40,9 +41,19 @@ func NewMetricDefinitionsClientWithBaseURI(baseURI string, subscriptionID string
}
// List lists the metric definitions for the resource.
-//
-// resourceURI is the identifier of the resource.
+// Parameters:
+// resourceURI - the identifier of the resource.
func (client MetricDefinitionsClient) List(ctx context.Context, resourceURI string) (result MetricDefinitionCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricDefinitionsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListPreparer(ctx, resourceURI)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.MetricDefinitionsClient", "List", nil, "Failure preparing request")
diff --git a/services/monitor/mgmt/2017-09-01/insights/metrics.go b/services/preview/monitor/mgmt/2017-05-01-preview/insights/metrics.go
similarity index 73%
rename from services/monitor/mgmt/2017-09-01/insights/metrics.go
rename to services/preview/monitor/mgmt/2017-05-01-preview/insights/metrics.go
index de5406300161..65be41dc06de 100644
--- a/services/monitor/mgmt/2017-09-01/insights/metrics.go
+++ b/services/preview/monitor/mgmt/2017-05-01-preview/insights/metrics.go
@@ -21,6 +21,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -40,23 +41,39 @@ func NewMetricsClientWithBaseURI(baseURI string, subscriptionID string) MetricsC
}
// List **Lists the metric values for a resource**.
-//
-// resourceURI is the identifier of the resource. timespan is the timespan of the query. It is a string with the
-// following format 'startDateTime_ISO/endDateTime_ISO'. interval is the interval (i.e. timegrain) of the query.
-// metric is the name of the metric to retrieve. aggregation is the list of aggregation types (comma separated) to
-// retrieve. top is the maximum number of records to retrieve.
+// Parameters:
+// resourceURI - the identifier of the resource.
+// timespan - the timespan of the query. It is a string with the following format
+// 'startDateTime_ISO/endDateTime_ISO'.
+// interval - the interval (i.e. timegrain) of the query.
+// metric - the name of the metric to retrieve.
+// aggregation - the list of aggregation types (comma separated) to retrieve.
+// top - the maximum number of records to retrieve.
// Valid only if $filter is specified.
-// Defaults to 10. orderby is the aggregation to use for sorting results and the direction of the sort.
+// Defaults to 10.
+// orderby - the aggregation to use for sorting results and the direction of the sort.
// Only one order can be specified.
-// Examples: sum asc. filter is the **$filter** is used to reduce the set of metric data
-// returned.
Example:
Metric contains metadata A, B and C.
- Return all time series of C where A = a1 and
-// B = b1 or b2
**$filter=A eq ‘a1’ and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid
-// variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘*’ or B = ‘b2’**
This is invalid because the logical
-// or operator cannot separate two different metadata names.
- Return all time series where A = a1, B = b1 and C
-// = c1:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C eq ‘c1’**
- Return all time series where A =
-// a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq ‘*’**. resultType is reduces the set of data collected. The
-// syntax allowed depends on the operation. See the operation's description for details.
+// Examples: sum asc.
+// filter - the **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains
+// metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’
+// and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C
+// eq ‘*’ or B = ‘b2’**
This is invalid because the logical or operator cannot separate two different
+// metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq
+// ‘b1’ and C eq ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq
+// ‘*’**.
+// resultType - reduces the set of data collected. The syntax allowed depends on the operation. See the
+// operation's description for details.
func (client MetricsClient) List(ctx context.Context, resourceURI string, timespan string, interval *string, metric string, aggregation string, top *float64, orderby string, filter string, resultType ResultType) (result Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListPreparer(ctx, resourceURI, timespan, interval, metric, aggregation, top, orderby, filter, resultType)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.MetricsClient", "List", nil, "Failure preparing request")
diff --git a/services/preview/monitor/mgmt/2017-05-01-preview/insights/models.go b/services/preview/monitor/mgmt/2017-05-01-preview/insights/models.go
index acec7e41f89a..9ae06d694d7c 100644
--- a/services/preview/monitor/mgmt/2017-05-01-preview/insights/models.go
+++ b/services/preview/monitor/mgmt/2017-05-01-preview/insights/models.go
@@ -30,6 +30,29 @@ import (
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights"
+// AggregationType enumerates the values for aggregation type.
+type AggregationType string
+
+const (
+ // Average ...
+ Average AggregationType = "Average"
+ // Count ...
+ Count AggregationType = "Count"
+ // Maximum ...
+ Maximum AggregationType = "Maximum"
+ // Minimum ...
+ Minimum AggregationType = "Minimum"
+ // None ...
+ None AggregationType = "None"
+ // Total ...
+ Total AggregationType = "Total"
+)
+
+// PossibleAggregationTypeValues returns an array of possible values for the AggregationType const type.
+func PossibleAggregationTypeValues() []AggregationType {
+ return []AggregationType{Average, Count, Maximum, Minimum, None, Total}
+}
+
// CategoryType enumerates the values for category type.
type CategoryType string
@@ -87,23 +110,44 @@ func PossibleConditionOperatorValues() []ConditionOperator {
return []ConditionOperator{ConditionOperatorGreaterThan, ConditionOperatorGreaterThanOrEqual, ConditionOperatorLessThan, ConditionOperatorLessThanOrEqual}
}
+// EventLevel enumerates the values for event level.
+type EventLevel string
+
+const (
+ // Critical ...
+ Critical EventLevel = "Critical"
+ // Error ...
+ Error EventLevel = "Error"
+ // Informational ...
+ Informational EventLevel = "Informational"
+ // Verbose ...
+ Verbose EventLevel = "Verbose"
+ // Warning ...
+ Warning EventLevel = "Warning"
+)
+
+// PossibleEventLevelValues returns an array of possible values for the EventLevel const type.
+func PossibleEventLevelValues() []EventLevel {
+ return []EventLevel{Critical, Error, Informational, Verbose, Warning}
+}
+
// MetricStatisticType enumerates the values for metric statistic type.
type MetricStatisticType string
const (
- // Average ...
- Average MetricStatisticType = "Average"
- // Max ...
- Max MetricStatisticType = "Max"
- // Min ...
- Min MetricStatisticType = "Min"
- // Sum ...
- Sum MetricStatisticType = "Sum"
+ // MetricStatisticTypeAverage ...
+ MetricStatisticTypeAverage MetricStatisticType = "Average"
+ // MetricStatisticTypeMax ...
+ MetricStatisticTypeMax MetricStatisticType = "Max"
+ // MetricStatisticTypeMin ...
+ MetricStatisticTypeMin MetricStatisticType = "Min"
+ // MetricStatisticTypeSum ...
+ MetricStatisticTypeSum MetricStatisticType = "Sum"
)
// PossibleMetricStatisticTypeValues returns an array of possible values for the MetricStatisticType const type.
func PossibleMetricStatisticTypeValues() []MetricStatisticType {
- return []MetricStatisticType{Average, Max, Min, Sum}
+ return []MetricStatisticType{MetricStatisticTypeAverage, MetricStatisticTypeMax, MetricStatisticTypeMin, MetricStatisticTypeSum}
}
// OdataType enumerates the values for odata type.
@@ -180,27 +224,42 @@ func PossibleReceiverStatusValues() []ReceiverStatus {
type RecurrenceFrequency string
const (
- // Day ...
- Day RecurrenceFrequency = "Day"
- // Hour ...
- Hour RecurrenceFrequency = "Hour"
- // Minute ...
- Minute RecurrenceFrequency = "Minute"
- // Month ...
- Month RecurrenceFrequency = "Month"
- // None ...
- None RecurrenceFrequency = "None"
- // Second ...
- Second RecurrenceFrequency = "Second"
- // Week ...
- Week RecurrenceFrequency = "Week"
- // Year ...
- Year RecurrenceFrequency = "Year"
+ // RecurrenceFrequencyDay ...
+ RecurrenceFrequencyDay RecurrenceFrequency = "Day"
+ // RecurrenceFrequencyHour ...
+ RecurrenceFrequencyHour RecurrenceFrequency = "Hour"
+ // RecurrenceFrequencyMinute ...
+ RecurrenceFrequencyMinute RecurrenceFrequency = "Minute"
+ // RecurrenceFrequencyMonth ...
+ RecurrenceFrequencyMonth RecurrenceFrequency = "Month"
+ // RecurrenceFrequencyNone ...
+ RecurrenceFrequencyNone RecurrenceFrequency = "None"
+ // RecurrenceFrequencySecond ...
+ RecurrenceFrequencySecond RecurrenceFrequency = "Second"
+ // RecurrenceFrequencyWeek ...
+ RecurrenceFrequencyWeek RecurrenceFrequency = "Week"
+ // RecurrenceFrequencyYear ...
+ RecurrenceFrequencyYear RecurrenceFrequency = "Year"
)
// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type.
func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency {
- return []RecurrenceFrequency{Day, Hour, Minute, Month, None, Second, Week, Year}
+ return []RecurrenceFrequency{RecurrenceFrequencyDay, RecurrenceFrequencyHour, RecurrenceFrequencyMinute, RecurrenceFrequencyMonth, RecurrenceFrequencyNone, RecurrenceFrequencySecond, RecurrenceFrequencyWeek, RecurrenceFrequencyYear}
+}
+
+// ResultType enumerates the values for result type.
+type ResultType string
+
+const (
+ // Data ...
+ Data ResultType = "Data"
+ // Metadata ...
+ Metadata ResultType = "Metadata"
+)
+
+// PossibleResultTypeValues returns an array of possible values for the ResultType const type.
+func PossibleResultTypeValues() []ResultType {
+ return []ResultType{Data, Metadata}
}
// ScaleDirection enumerates the values for scale direction.
@@ -237,6 +296,23 @@ func PossibleScaleTypeValues() []ScaleType {
return []ScaleType{ChangeCount, ExactCount, PercentChangeCount}
}
+// Sensitivity enumerates the values for sensitivity.
+type Sensitivity string
+
+const (
+ // High ...
+ High Sensitivity = "High"
+ // Low ...
+ Low Sensitivity = "Low"
+ // Medium ...
+ Medium Sensitivity = "Medium"
+)
+
+// PossibleSensitivityValues returns an array of possible values for the Sensitivity const type.
+func PossibleSensitivityValues() []Sensitivity {
+ return []Sensitivity{High, Low, Medium}
+}
+
// TimeAggregationOperator enumerates the values for time aggregation operator.
type TimeAggregationOperator string
@@ -281,6 +357,35 @@ func PossibleTimeAggregationTypeValues() []TimeAggregationType {
return []TimeAggregationType{TimeAggregationTypeAverage, TimeAggregationTypeCount, TimeAggregationTypeLast, TimeAggregationTypeMaximum, TimeAggregationTypeMinimum, TimeAggregationTypeTotal}
}
+// Unit enumerates the values for unit.
+type Unit string
+
+const (
+ // UnitBytes ...
+ UnitBytes Unit = "Bytes"
+ // UnitByteSeconds ...
+ UnitByteSeconds Unit = "ByteSeconds"
+ // UnitBytesPerSecond ...
+ UnitBytesPerSecond Unit = "BytesPerSecond"
+ // UnitCount ...
+ UnitCount Unit = "Count"
+ // UnitCountPerSecond ...
+ UnitCountPerSecond Unit = "CountPerSecond"
+ // UnitMilliSeconds ...
+ UnitMilliSeconds Unit = "MilliSeconds"
+ // UnitPercent ...
+ UnitPercent Unit = "Percent"
+ // UnitSeconds ...
+ UnitSeconds Unit = "Seconds"
+ // UnitUnspecified ...
+ UnitUnspecified Unit = "Unspecified"
+)
+
+// PossibleUnitValues returns an array of possible values for the Unit const type.
+func PossibleUnitValues() []Unit {
+ return []Unit{UnitBytes, UnitByteSeconds, UnitBytesPerSecond, UnitCount, UnitCountPerSecond, UnitMilliSeconds, UnitPercent, UnitSeconds, UnitUnspecified}
+}
+
// ActionGroup an Azure action group.
type ActionGroup struct {
// GroupShortName - The short name of the action group. This will be used in SMS messages.
@@ -1367,6 +1472,133 @@ type AzureFunctionReceiver struct {
HTTPTriggerURL *string `json:"httpTriggerUrl,omitempty"`
}
+// Baseline the baseline values for a single sensitivity value.
+type Baseline struct {
+ // Sensitivity - the sensitivity of the baseline. Possible values include: 'Low', 'Medium', 'High'
+ Sensitivity Sensitivity `json:"sensitivity,omitempty"`
+ // LowThresholds - The low thresholds of the baseline.
+ LowThresholds *[]float64 `json:"lowThresholds,omitempty"`
+ // HighThresholds - The high thresholds of the baseline.
+ HighThresholds *[]float64 `json:"highThresholds,omitempty"`
+}
+
+// BaselineMetadataValue represents a baseline metadata value.
+type BaselineMetadataValue struct {
+ // Name - the name of the metadata.
+ Name *LocalizableString `json:"name,omitempty"`
+ // Value - the value of the metadata.
+ Value *string `json:"value,omitempty"`
+}
+
+// BaselineProperties the baseline properties class.
+type BaselineProperties struct {
+ // Timespan - The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested.
+ Timespan *string `json:"timespan,omitempty"`
+ // Interval - The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made.
+ Interval *string `json:"interval,omitempty"`
+ // Aggregation - The aggregation type of the metric.
+ Aggregation *string `json:"aggregation,omitempty"`
+ // Timestamps - the array of timestamps of the baselines.
+ Timestamps *[]date.Time `json:"timestamps,omitempty"`
+ // Baseline - the baseline values for each sensitivity.
+ Baseline *[]Baseline `json:"baseline,omitempty"`
+ // Metadata - the baseline metadata values.
+ Metadata *[]BaselineMetadataValue `json:"metadata,omitempty"`
+}
+
+// BaselineResponse the response to a baseline query.
+type BaselineResponse struct {
+ autorest.Response `json:"-"`
+ // ID - the metric baseline Id.
+ ID *string `json:"id,omitempty"`
+ // Type - the resource type of the baseline resource.
+ Type *string `json:"type,omitempty"`
+ // Name - the name and the display name of the metric, i.e. it is localizable string.
+ Name *LocalizableString `json:"name,omitempty"`
+ // BaselineProperties - the properties of the baseline.
+ *BaselineProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for BaselineResponse.
+func (br BaselineResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if br.ID != nil {
+ objectMap["id"] = br.ID
+ }
+ if br.Type != nil {
+ objectMap["type"] = br.Type
+ }
+ if br.Name != nil {
+ objectMap["name"] = br.Name
+ }
+ if br.BaselineProperties != nil {
+ objectMap["properties"] = br.BaselineProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for BaselineResponse struct.
+func (br *BaselineResponse) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ br.ID = &ID
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ br.Type = &typeVar
+ }
+ case "name":
+ if v != nil {
+ var name LocalizableString
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ br.Name = &name
+ }
+ case "properties":
+ if v != nil {
+ var baselineProperties BaselineProperties
+ err = json.Unmarshal(*v, &baselineProperties)
+ if err != nil {
+ return err
+ }
+ br.BaselineProperties = &baselineProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// CalculateBaselineResponse the response to a calculate baseline call.
+type CalculateBaselineResponse struct {
+ autorest.Response `json:"-"`
+ // Type - the resource type of the baseline resource.
+ Type *string `json:"type,omitempty"`
+ // Timestamps - the array of timestamps of the baselines.
+ Timestamps *[]date.Time `json:"timestamps,omitempty"`
+ // Baseline - the baseline values for each sensitivity.
+ Baseline *[]Baseline `json:"baseline,omitempty"`
+}
+
// DiagnosticSettings the diagnostic settings.
type DiagnosticSettings struct {
// StorageAccountID - The resource ID of the storage account to which you would like to send Diagnostic Logs.
@@ -1604,6 +1836,302 @@ type ErrorResponse struct {
Message *string `json:"message,omitempty"`
}
+// EventCategoryCollection a collection of event categories. Currently possible values are: Administrative,
+// Security, ServiceHealth, Alert, Recommendation, Policy.
+type EventCategoryCollection struct {
+ autorest.Response `json:"-"`
+ // Value - the list that includes the Azure event categories.
+ Value *[]LocalizableString `json:"value,omitempty"`
+}
+
+// EventData the Azure event log entries are of type EventData
+type EventData struct {
+ // Authorization - The sender authorization information.
+ Authorization *SenderAuthorization `json:"authorization,omitempty"`
+ // Claims - key value pairs to identify ARM permissions.
+ Claims map[string]*string `json:"claims"`
+ // Caller - the email address of the user who has performed the operation, the UPN claim or SPN claim based on availability.
+ Caller *string `json:"caller,omitempty"`
+ // Description - the description of the event.
+ Description *string `json:"description,omitempty"`
+ // ID - the Id of this event as required by ARM for RBAC. It contains the EventDataID and a timestamp information.
+ ID *string `json:"id,omitempty"`
+ // EventDataID - the event data Id. This is a unique identifier for an event.
+ EventDataID *string `json:"eventDataId,omitempty"`
+ // CorrelationID - the correlation Id, usually a GUID in the string format. The correlation Id is shared among the events that belong to the same uber operation.
+ CorrelationID *string `json:"correlationId,omitempty"`
+ // EventName - the event name. This value should not be confused with OperationName. For practical purposes, OperationName might be more appealing to end users.
+ EventName *LocalizableString `json:"eventName,omitempty"`
+ // Category - the event category.
+ Category *LocalizableString `json:"category,omitempty"`
+ // HTTPRequest - the HTTP request info. Usually includes the 'clientRequestId', 'clientIpAddress' (IP address of the user who initiated the event) and 'method' (HTTP method e.g. PUT).
+ HTTPRequest *HTTPRequestInfo `json:"httpRequest,omitempty"`
+ // Level - the event level. Possible values include: 'Critical', 'Error', 'Warning', 'Informational', 'Verbose'
+ Level EventLevel `json:"level,omitempty"`
+ // ResourceGroupName - the resource group name of the impacted resource.
+ ResourceGroupName *string `json:"resourceGroupName,omitempty"`
+ // ResourceProviderName - the resource provider name of the impacted resource.
+ ResourceProviderName *LocalizableString `json:"resourceProviderName,omitempty"`
+ // ResourceID - the resource uri that uniquely identifies the resource that caused this event.
+ ResourceID *string `json:"resourceId,omitempty"`
+ // ResourceType - the resource type
+ ResourceType *LocalizableString `json:"resourceType,omitempty"`
+ // OperationID - It is usually a GUID shared among the events corresponding to single operation. This value should not be confused with EventName.
+ OperationID *string `json:"operationId,omitempty"`
+ // OperationName - the operation name.
+ OperationName *LocalizableString `json:"operationName,omitempty"`
+ // Properties - the set of pairs (usually a Dictionary) that includes details about the event.
+ Properties map[string]*string `json:"properties"`
+ // Status - a string describing the status of the operation. Some typical values are: Started, In progress, Succeeded, Failed, Resolved.
+ Status *LocalizableString `json:"status,omitempty"`
+ // SubStatus - the event sub status. Most of the time, when included, this captures the HTTP status code of the REST call. Common values are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP Status Code: 409), Internal Server Error (HTTP Status Code: 500), Service Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: 504)
+ SubStatus *LocalizableString `json:"subStatus,omitempty"`
+ // EventTimestamp - the timestamp of when the event was generated by the Azure service processing the request corresponding the event. It in ISO 8601 format.
+ EventTimestamp *date.Time `json:"eventTimestamp,omitempty"`
+ // SubmissionTimestamp - the timestamp of when the event became available for querying via this API. It is in ISO 8601 format. This value should not be confused eventTimestamp. As there might be a delay between the occurrence time of the event, and the time that the event is submitted to the Azure logging infrastructure.
+ SubmissionTimestamp *date.Time `json:"submissionTimestamp,omitempty"`
+ // SubscriptionID - the Azure subscription Id usually a GUID.
+ SubscriptionID *string `json:"subscriptionId,omitempty"`
+ // TenantID - the Azure tenant Id
+ TenantID *string `json:"tenantId,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for EventData.
+func (ed EventData) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if ed.Authorization != nil {
+ objectMap["authorization"] = ed.Authorization
+ }
+ if ed.Claims != nil {
+ objectMap["claims"] = ed.Claims
+ }
+ if ed.Caller != nil {
+ objectMap["caller"] = ed.Caller
+ }
+ if ed.Description != nil {
+ objectMap["description"] = ed.Description
+ }
+ if ed.ID != nil {
+ objectMap["id"] = ed.ID
+ }
+ if ed.EventDataID != nil {
+ objectMap["eventDataId"] = ed.EventDataID
+ }
+ if ed.CorrelationID != nil {
+ objectMap["correlationId"] = ed.CorrelationID
+ }
+ if ed.EventName != nil {
+ objectMap["eventName"] = ed.EventName
+ }
+ if ed.Category != nil {
+ objectMap["category"] = ed.Category
+ }
+ if ed.HTTPRequest != nil {
+ objectMap["httpRequest"] = ed.HTTPRequest
+ }
+ if ed.Level != "" {
+ objectMap["level"] = ed.Level
+ }
+ if ed.ResourceGroupName != nil {
+ objectMap["resourceGroupName"] = ed.ResourceGroupName
+ }
+ if ed.ResourceProviderName != nil {
+ objectMap["resourceProviderName"] = ed.ResourceProviderName
+ }
+ if ed.ResourceID != nil {
+ objectMap["resourceId"] = ed.ResourceID
+ }
+ if ed.ResourceType != nil {
+ objectMap["resourceType"] = ed.ResourceType
+ }
+ if ed.OperationID != nil {
+ objectMap["operationId"] = ed.OperationID
+ }
+ if ed.OperationName != nil {
+ objectMap["operationName"] = ed.OperationName
+ }
+ if ed.Properties != nil {
+ objectMap["properties"] = ed.Properties
+ }
+ if ed.Status != nil {
+ objectMap["status"] = ed.Status
+ }
+ if ed.SubStatus != nil {
+ objectMap["subStatus"] = ed.SubStatus
+ }
+ if ed.EventTimestamp != nil {
+ objectMap["eventTimestamp"] = ed.EventTimestamp
+ }
+ if ed.SubmissionTimestamp != nil {
+ objectMap["submissionTimestamp"] = ed.SubmissionTimestamp
+ }
+ if ed.SubscriptionID != nil {
+ objectMap["subscriptionId"] = ed.SubscriptionID
+ }
+ if ed.TenantID != nil {
+ objectMap["tenantId"] = ed.TenantID
+ }
+ return json.Marshal(objectMap)
+}
+
+// EventDataCollection represents collection of events.
+type EventDataCollection struct {
+ autorest.Response `json:"-"`
+ // Value - this list that includes the Azure audit logs.
+ Value *[]EventData `json:"value,omitempty"`
+ // NextLink - Provides the link to retrieve the next set of events.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// EventDataCollectionIterator provides access to a complete listing of EventData values.
+type EventDataCollectionIterator struct {
+ i int
+ page EventDataCollectionPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *EventDataCollectionIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *EventDataCollectionIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter EventDataCollectionIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter EventDataCollectionIterator) Response() EventDataCollection {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter EventDataCollectionIterator) Value() EventData {
+ if !iter.page.NotDone() {
+ return EventData{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the EventDataCollectionIterator type.
+func NewEventDataCollectionIterator(page EventDataCollectionPage) EventDataCollectionIterator {
+ return EventDataCollectionIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (edc EventDataCollection) IsEmpty() bool {
+ return edc.Value == nil || len(*edc.Value) == 0
+}
+
+// eventDataCollectionPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (edc EventDataCollection) eventDataCollectionPreparer(ctx context.Context) (*http.Request, error) {
+ if edc.NextLink == nil || len(to.String(edc.NextLink)) < 1 {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(edc.NextLink)))
+}
+
+// EventDataCollectionPage contains a page of EventData values.
+type EventDataCollectionPage struct {
+ fn func(context.Context, EventDataCollection) (EventDataCollection, error)
+ edc EventDataCollection
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *EventDataCollectionPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ next, err := page.fn(ctx, page.edc)
+ if err != nil {
+ return err
+ }
+ page.edc = next
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *EventDataCollectionPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page EventDataCollectionPage) NotDone() bool {
+ return !page.edc.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page EventDataCollectionPage) Response() EventDataCollection {
+ return page.edc
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page EventDataCollectionPage) Values() []EventData {
+ if page.edc.IsEmpty() {
+ return nil
+ }
+ return *page.edc.Value
+}
+
+// Creates a new instance of the EventDataCollectionPage type.
+func NewEventDataCollectionPage(getNextPage func(context.Context, EventDataCollection) (EventDataCollection, error)) EventDataCollectionPage {
+ return EventDataCollectionPage{fn: getNextPage}
+}
+
+// HTTPRequestInfo the Http request info.
+type HTTPRequestInfo struct {
+ // ClientRequestID - the client request id.
+ ClientRequestID *string `json:"clientRequestId,omitempty"`
+ // ClientIPAddress - the client Ip Address
+ ClientIPAddress *string `json:"clientIpAddress,omitempty"`
+ // Method - the Http request method.
+ Method *string `json:"method,omitempty"`
+ // URI - the Uri.
+ URI *string `json:"uri,omitempty"`
+}
+
// Incident an alert incident indicates the activation status of an alert rule.
type Incident struct {
autorest.Response `json:"-"`
@@ -1640,6 +2168,14 @@ type ItsmReceiver struct {
Region *string `json:"region,omitempty"`
}
+// LocalizableString the localizable string class.
+type LocalizableString struct {
+ // Value - the invariant value.
+ Value *string `json:"value,omitempty"`
+ // LocalizedValue - the locale specific value.
+ LocalizedValue *string `json:"localizedValue,omitempty"`
+}
+
// LocationThresholdRuleCondition a rule condition based on a certain number of locations failing.
type LocationThresholdRuleCondition struct {
// WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day.
@@ -2048,6 +2584,64 @@ func (merc *ManagementEventRuleCondition) UnmarshalJSON(body []byte) error {
return nil
}
+// MetadataValue represents a metric metadata value.
+type MetadataValue struct {
+ // Name - the name of the metadata.
+ Name *LocalizableString `json:"name,omitempty"`
+ // Value - the value of the metadata.
+ Value *string `json:"value,omitempty"`
+}
+
+// Metric the result data of a query.
+type Metric struct {
+ // ID - the metric Id.
+ ID *string `json:"id,omitempty"`
+ // Type - the resource type of the metric resource.
+ Type *string `json:"type,omitempty"`
+ // Name - the name and the display name of the metric, i.e. it is localizable string.
+ Name *LocalizableString `json:"name,omitempty"`
+ // Unit - the unit of the metric. Possible values include: 'UnitCount', 'UnitBytes', 'UnitSeconds', 'UnitCountPerSecond', 'UnitBytesPerSecond', 'UnitPercent', 'UnitMilliSeconds', 'UnitByteSeconds', 'UnitUnspecified'
+ Unit Unit `json:"unit,omitempty"`
+ // Timeseries - the time series returned when a data query is performed.
+ Timeseries *[]TimeSeriesElement `json:"timeseries,omitempty"`
+}
+
+// MetricAvailability metric availability specifies the time grain (aggregation interval or frequency) and
+// the retention period for that time grain.
+type MetricAvailability struct {
+ // TimeGrain - the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc.
+ TimeGrain *string `json:"timeGrain,omitempty"`
+ // Retention - the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc.
+ Retention *string `json:"retention,omitempty"`
+}
+
+// MetricDefinition metric definition class specifies the metadata for a metric.
+type MetricDefinition struct {
+ // IsDimensionRequired - Flag to indicate whether the dimension is required.
+ IsDimensionRequired *bool `json:"isDimensionRequired,omitempty"`
+ // ResourceID - the resource identifier of the resource that emitted the metric.
+ ResourceID *string `json:"resourceId,omitempty"`
+ // Name - the name and the display name of the metric, i.e. it is a localizable string.
+ Name *LocalizableString `json:"name,omitempty"`
+ // Unit - the unit of the metric. Possible values include: 'UnitCount', 'UnitBytes', 'UnitSeconds', 'UnitCountPerSecond', 'UnitBytesPerSecond', 'UnitPercent', 'UnitMilliSeconds', 'UnitByteSeconds', 'UnitUnspecified'
+ Unit Unit `json:"unit,omitempty"`
+ // PrimaryAggregationType - the primary aggregation type value defining how to use the values for display. Possible values include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total'
+ PrimaryAggregationType AggregationType `json:"primaryAggregationType,omitempty"`
+ // MetricAvailabilities - the collection of what aggregation intervals are available to be queried.
+ MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
+ // ID - the resource identifier of the metric definition.
+ ID *string `json:"id,omitempty"`
+ // Dimensions - the name and the display name of the dimension, i.e. it is a localizable string.
+ Dimensions *[]LocalizableString `json:"dimensions,omitempty"`
+}
+
+// MetricDefinitionCollection represents collection of metric definitions.
+type MetricDefinitionCollection struct {
+ autorest.Response `json:"-"`
+ // Value - the values for the metric definitions.
+ Value *[]MetricDefinition `json:"value,omitempty"`
+}
+
// MetricSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric.
type MetricSettings struct {
// TimeGrain - the timegrain of the metric in ISO8601 format.
@@ -2068,7 +2662,7 @@ type MetricTrigger struct {
MetricResourceURI *string `json:"metricResourceUri,omitempty"`
// TimeGrain - the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute.
TimeGrain *string `json:"timeGrain,omitempty"`
- // Statistic - the metric statistic type. How the metrics from multiple instances are combined. Possible values include: 'Average', 'Min', 'Max', 'Sum'
+ // Statistic - the metric statistic type. How the metrics from multiple instances are combined. Possible values include: 'MetricStatisticTypeAverage', 'MetricStatisticTypeMin', 'MetricStatisticTypeMax', 'MetricStatisticTypeSum'
Statistic MetricStatisticType `json:"statistic,omitempty"`
// TimeWindow - the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes.
TimeWindow *string `json:"timeWindow,omitempty"`
@@ -2080,6 +2674,22 @@ type MetricTrigger struct {
Threshold *float64 `json:"threshold,omitempty"`
}
+// MetricValue represents a metric value.
+type MetricValue struct {
+ // TimeStamp - the timestamp for the metric value in ISO 8601 format.
+ TimeStamp *date.Time `json:"timeStamp,omitempty"`
+ // Average - the average value in the time range.
+ Average *float64 `json:"average,omitempty"`
+ // Minimum - the least value in the time range.
+ Minimum *float64 `json:"minimum,omitempty"`
+ // Maximum - the greatest value in the time range.
+ Maximum *float64 `json:"maximum,omitempty"`
+ // Total - the sum of all of the values in the time range.
+ Total *float64 `json:"total,omitempty"`
+ // Count - the number of samples in the time range. Can be used to determine the number of values that contributed to the average value.
+ Count *int64 `json:"count,omitempty"`
+}
+
// Operation microsoft Insights API operation definition.
type Operation struct {
// Name - Operation name: {provider}/{resource}/{operation}
@@ -2121,7 +2731,7 @@ type ProxyOnlyResource struct {
// Recurrence the repeating times at which this profile begins. This element is not used if the FixedDate
// element is used.
type Recurrence struct {
- // Frequency - the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly. Possible values include: 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', 'Month', 'Year'
+ // Frequency - the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly. Possible values include: 'RecurrenceFrequencyNone', 'RecurrenceFrequencySecond', 'RecurrenceFrequencyMinute', 'RecurrenceFrequencyHour', 'RecurrenceFrequencyDay', 'RecurrenceFrequencyWeek', 'RecurrenceFrequencyMonth', 'RecurrenceFrequencyYear'
Frequency RecurrenceFrequency `json:"frequency,omitempty"`
// Schedule - the scheduling constraints for when the profile begins.
Schedule *RecurrentSchedule `json:"schedule,omitempty"`
@@ -2174,6 +2784,19 @@ func (r Resource) MarshalJSON() ([]byte, error) {
return json.Marshal(objectMap)
}
+// Response the response to a metrics query.
+type Response struct {
+ autorest.Response `json:"-"`
+ // Cost - The integer value representing the cost of the query, for data case.
+ Cost *float64 `json:"cost,omitempty"`
+ // Timespan - The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested.
+ Timespan *string `json:"timespan,omitempty"`
+ // Interval - The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made.
+ Interval *string `json:"interval,omitempty"`
+ // Value - the value of the collection.
+ Value *[]Metric `json:"value,omitempty"`
+}
+
// RetentionPolicy specifies the retention policy for the log.
type RetentionPolicy struct {
// Enabled - a value indicating whether the retention policy is enabled.
@@ -2750,6 +3373,18 @@ type ScaleRule struct {
ScaleAction *ScaleAction `json:"scaleAction,omitempty"`
}
+// SenderAuthorization the authorization used by the user who has performed the operation that led to this
+// event. This captures the RBAC properties of the event. These usually include the 'action', 'role' and
+// the 'scope'
+type SenderAuthorization struct {
+ // Action - the permissible actions. For instance: microsoft.support/supporttickets/write
+ Action *string `json:"action,omitempty"`
+ // Role - the role of the user. For instance: Subscription Admin
+ Role *string `json:"role,omitempty"`
+ // Scope - the scope.
+ Scope *string `json:"scope,omitempty"`
+}
+
// SmsReceiver an SMS receiver.
type SmsReceiver struct {
// Name - The name of the SMS receiver. Names must be unique across all receivers within an action group.
@@ -2894,6 +3529,24 @@ func (trc *ThresholdRuleCondition) UnmarshalJSON(body []byte) error {
return nil
}
+// TimeSeriesElement a time series result type. The discriminator value is always TimeSeries in this case.
+type TimeSeriesElement struct {
+ // Metadatavalues - the metadata values returned if $filter was specified in the call.
+ Metadatavalues *[]MetadataValue `json:"metadatavalues,omitempty"`
+ // Data - An array of data points representing the metric values. This is only returned if a result type of data is specified.
+ Data *[]MetricValue `json:"data,omitempty"`
+}
+
+// TimeSeriesInformation the time series info needed for calculating the baseline.
+type TimeSeriesInformation struct {
+ // Sensitivities - the list of sensitivities for calculating the baseline.
+ Sensitivities *[]string `json:"sensitivities,omitempty"`
+ // Values - The metric values to calculate the baseline.
+ Values *[]float64 `json:"values,omitempty"`
+ // Timestamps - the array of timestamps of the baselines.
+ Timestamps *[]date.Time `json:"timestamps,omitempty"`
+}
+
// TimeWindow a specific date-time for the profile.
type TimeWindow struct {
// TimeZone - the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time
diff --git a/services/monitor/mgmt/2017-09-01/insights/tenantactivitylogs.go b/services/preview/monitor/mgmt/2017-05-01-preview/insights/tenantactivitylogs.go
similarity index 76%
rename from services/monitor/mgmt/2017-09-01/insights/tenantactivitylogs.go
rename to services/preview/monitor/mgmt/2017-05-01-preview/insights/tenantactivitylogs.go
index 88a53cd2c0d4..14e2c2b18dce 100644
--- a/services/monitor/mgmt/2017-09-01/insights/tenantactivitylogs.go
+++ b/services/preview/monitor/mgmt/2017-05-01-preview/insights/tenantactivitylogs.go
@@ -21,6 +21,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -43,24 +44,35 @@ func NewTenantActivityLogsClientWithBaseURI(baseURI string, subscriptionID strin
// the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that
// this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that
// were generated at the tenant level.
-//
-// filter is reduces the set of data collected.
The **$filter** is very restricted and allows only the
+// Parameters:
+// filter - reduces the set of data collected.
The **$filter** is very restricted and allows only the
// following patterns.
- List events for a resource group: $filter=eventTimestamp ge '' and
// eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceGroupName eq
// ''.
- List events for resource: $filter=eventTimestamp ge '' and
-// eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceUri eq ''.
-
-// List events for a subscription: $filter=eventTimestamp ge '' and eventTimestamp le '' and
-// eventChannels eq 'Admin, Operation'.
- List events for a resource provider: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceProvider eq
-// ''.
- List events for a correlation Id: api-version=2014-04-01&$filter=eventTimestamp
-// ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and eventChannels eq
-// 'Admin, Operation' and correlationId eq ''.
**NOTE**: No other syntax is allowed.
-// selectParameter is used to fetch events with only the given properties.
The **$select** argument is a comma
-// separated list of property names to be returned. Possible values are: *authorization*, *claims*,
+// eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceUri eq
+// ''.
- List events for a subscription: $filter=eventTimestamp ge '' and
+// eventTimestamp le '' and eventChannels eq 'Admin, Operation'.
- List events for a resource
+// provider: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq
+// 'Admin, Operation' and resourceProvider eq ''.
- List events for a correlation Id:
+// api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le
+// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq
+// ''.
**NOTE**: No other syntax is allowed.
+// selectParameter - used to fetch events with only the given properties.
The **$select** argument is a
+// comma separated list of property names to be returned. Possible values are: *authorization*, *claims*,
// *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*,
// *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*,
// *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*
func (client TenantActivityLogsClient) List(ctx context.Context, filter string, selectParameter string) (result EventDataCollectionPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/TenantActivityLogsClient.List")
+ defer func() {
+ sc := -1
+ if result.edc.Response.Response != nil {
+ sc = result.edc.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, filter, selectParameter)
if err != nil {
@@ -125,8 +137,8 @@ func (client TenantActivityLogsClient) ListResponder(resp *http.Response) (resul
}
// listNextResults retrieves the next set of results, if any.
-func (client TenantActivityLogsClient) listNextResults(lastResults EventDataCollection) (result EventDataCollection, err error) {
- req, err := lastResults.eventDataCollectionPreparer()
+func (client TenantActivityLogsClient) listNextResults(ctx context.Context, lastResults EventDataCollection) (result EventDataCollection, err error) {
+ req, err := lastResults.eventDataCollectionPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "insights.TenantActivityLogsClient", "listNextResults", nil, "Failure preparing next results request")
}
@@ -147,6 +159,16 @@ func (client TenantActivityLogsClient) listNextResults(lastResults EventDataColl
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client TenantActivityLogsClient) ListComplete(ctx context.Context, filter string, selectParameter string) (result EventDataCollectionIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/TenantActivityLogsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
result.page, err = client.List(ctx, filter, selectParameter)
return
}
diff --git a/services/monitor/mgmt/2017-09-01/insights/actiongroups.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/actiongroups.go
similarity index 86%
rename from services/monitor/mgmt/2017-09-01/insights/actiongroups.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/actiongroups.go
index b40ffa0b9f98..d4466837d87d 100644
--- a/services/monitor/mgmt/2017-09-01/insights/actiongroups.go
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/actiongroups.go
@@ -22,6 +22,7 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -41,15 +42,26 @@ func NewActionGroupsClientWithBaseURI(baseURI string, subscriptionID string) Act
}
// CreateOrUpdate create a new action group or update an existing one.
-//
-// resourceGroupName is the name of the resource group. actionGroupName is the name of the action group.
-// actionGroup is the action group to create or use for the update.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// actionGroupName - the name of the action group.
+// actionGroup - the action group to create or use for the update.
func (client ActionGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroup ActionGroupResource) (result ActionGroupResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
if err := validation.Validate([]validation.Validation{
{TargetValue: actionGroup,
Constraints: []validation.Constraint{{Target: "actionGroup.ActionGroup", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "actionGroup.ActionGroup.GroupShortName", Name: validation.Null, Rule: true,
- Chain: []validation.Constraint{{Target: "actionGroup.ActionGroup.GroupShortName", Name: validation.MaxLength, Rule: 15, Chain: nil}}},
+ Chain: []validation.Constraint{{Target: "actionGroup.ActionGroup.GroupShortName", Name: validation.MaxLength, Rule: 12, Chain: nil}}},
{Target: "actionGroup.ActionGroup.Enabled", Name: validation.Null, Rule: true, Chain: nil},
}}}}}); err != nil {
return result, validation.NewError("insights.ActionGroupsClient", "CreateOrUpdate", err.Error())
@@ -84,13 +96,13 @@ func (client ActionGroupsClient) CreateOrUpdatePreparer(ctx context.Context, res
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2018-03-01"
+ const APIVersion = "2018-09-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}", pathParameters),
@@ -120,9 +132,20 @@ func (client ActionGroupsClient) CreateOrUpdateResponder(resp *http.Response) (r
}
// Delete delete an action group.
-//
-// resourceGroupName is the name of the resource group. actionGroupName is the name of the action group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// actionGroupName - the name of the action group.
func (client ActionGroupsClient) Delete(ctx context.Context, resourceGroupName string, actionGroupName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.DeletePreparer(ctx, resourceGroupName, actionGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Delete", nil, "Failure preparing request")
@@ -152,7 +175,7 @@ func (client ActionGroupsClient) DeletePreparer(ctx context.Context, resourceGro
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2018-03-01"
+ const APIVersion = "2018-09-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -185,10 +208,22 @@ func (client ActionGroupsClient) DeleteResponder(resp *http.Response) (result au
}
// EnableReceiver enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled.
-//
-// resourceGroupName is the name of the resource group. actionGroupName is the name of the action group.
-// enableRequest is the receiver to re-enable.
+// This operation is only supported for Email or SMS receivers.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// actionGroupName - the name of the action group.
+// enableRequest - the receiver to re-enable.
func (client ActionGroupsClient) EnableReceiver(ctx context.Context, resourceGroupName string, actionGroupName string, enableRequest EnableRequest) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.EnableReceiver")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
if err := validation.Validate([]validation.Validation{
{TargetValue: enableRequest,
Constraints: []validation.Constraint{{Target: "enableRequest.ReceiverName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
@@ -224,13 +259,13 @@ func (client ActionGroupsClient) EnableReceiverPreparer(ctx context.Context, res
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2018-03-01"
+ const APIVersion = "2018-09-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}/subscribe", pathParameters),
@@ -259,9 +294,20 @@ func (client ActionGroupsClient) EnableReceiverResponder(resp *http.Response) (r
}
// Get get an action group.
-//
-// resourceGroupName is the name of the resource group. actionGroupName is the name of the action group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// actionGroupName - the name of the action group.
func (client ActionGroupsClient) Get(ctx context.Context, resourceGroupName string, actionGroupName string) (result ActionGroupResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.GetPreparer(ctx, resourceGroupName, actionGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Get", nil, "Failure preparing request")
@@ -291,7 +337,7 @@ func (client ActionGroupsClient) GetPreparer(ctx context.Context, resourceGroupN
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2018-03-01"
+ const APIVersion = "2018-09-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -325,9 +371,19 @@ func (client ActionGroupsClient) GetResponder(resp *http.Response) (result Actio
}
// ListByResourceGroup get a list of all action groups in a resource group.
-//
-// resourceGroupName is the name of the resource group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
func (client ActionGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ActionGroupList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.ListByResourceGroup")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListByResourceGroup", nil, "Failure preparing request")
@@ -356,7 +412,7 @@ func (client ActionGroupsClient) ListByResourceGroupPreparer(ctx context.Context
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2018-03-01"
+ const APIVersion = "2018-09-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -391,6 +447,16 @@ func (client ActionGroupsClient) ListByResourceGroupResponder(resp *http.Respons
// ListBySubscriptionID get a list of all action groups in a subscription.
func (client ActionGroupsClient) ListBySubscriptionID(ctx context.Context) (result ActionGroupList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.ListBySubscriptionID")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListBySubscriptionIDPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListBySubscriptionID", nil, "Failure preparing request")
@@ -418,7 +484,7 @@ func (client ActionGroupsClient) ListBySubscriptionIDPreparer(ctx context.Contex
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2018-03-01"
+ const APIVersion = "2018-09-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
@@ -452,10 +518,21 @@ func (client ActionGroupsClient) ListBySubscriptionIDResponder(resp *http.Respon
}
// Update updates an existing action group's tags. To update other fields use the CreateOrUpdate method.
-//
-// resourceGroupName is the name of the resource group. actionGroupName is the name of the action group.
-// actionGroupPatch is parameters supplied to the operation.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// actionGroupName - the name of the action group.
+// actionGroupPatch - parameters supplied to the operation.
func (client ActionGroupsClient) Update(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroupPatch ActionGroupPatchBody) (result ActionGroupResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.Update")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.UpdatePreparer(ctx, resourceGroupName, actionGroupName, actionGroupPatch)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Update", nil, "Failure preparing request")
@@ -485,13 +562,13 @@ func (client ActionGroupsClient) UpdatePreparer(ctx context.Context, resourceGro
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
- const APIVersion = "2018-03-01"
+ const APIVersion = "2018-09-01"
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}", pathParameters),
diff --git a/services/monitor/mgmt/2017-09-01/insights/activitylogalerts.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/activitylogalerts.go
similarity index 88%
rename from services/monitor/mgmt/2017-09-01/insights/activitylogalerts.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/activitylogalerts.go
index 2bec8ef818a6..1e0b071bed4d 100644
--- a/services/monitor/mgmt/2017-09-01/insights/activitylogalerts.go
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/activitylogalerts.go
@@ -22,6 +22,7 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -41,10 +42,21 @@ func NewActivityLogAlertsClientWithBaseURI(baseURI string, subscriptionID string
}
// CreateOrUpdate create a new activity log alert or update an existing one.
-//
-// resourceGroupName is the name of the resource group. activityLogAlertName is the name of the activity log alert.
-// activityLogAlert is the activity log alert to create or use for the update.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// activityLogAlertName - the name of the activity log alert.
+// activityLogAlert - the activity log alert to create or use for the update.
func (client ActivityLogAlertsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlert ActivityLogAlertResource) (result ActivityLogAlertResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActivityLogAlertsClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
if err := validation.Validate([]validation.Validation{
{TargetValue: activityLogAlert,
Constraints: []validation.Constraint{{Target: "activityLogAlert.ActivityLogAlert", Name: validation.Null, Rule: false,
@@ -91,7 +103,7 @@ func (client ActivityLogAlertsClient) CreateOrUpdatePreparer(ctx context.Context
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}", pathParameters),
@@ -121,9 +133,20 @@ func (client ActivityLogAlertsClient) CreateOrUpdateResponder(resp *http.Respons
}
// Delete delete an activity log alert.
-//
-// resourceGroupName is the name of the resource group. activityLogAlertName is the name of the activity log alert.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// activityLogAlertName - the name of the activity log alert.
func (client ActivityLogAlertsClient) Delete(ctx context.Context, resourceGroupName string, activityLogAlertName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActivityLogAlertsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.DeletePreparer(ctx, resourceGroupName, activityLogAlertName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Delete", nil, "Failure preparing request")
@@ -186,9 +209,20 @@ func (client ActivityLogAlertsClient) DeleteResponder(resp *http.Response) (resu
}
// Get get an activity log alert.
-//
-// resourceGroupName is the name of the resource group. activityLogAlertName is the name of the activity log alert.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// activityLogAlertName - the name of the activity log alert.
func (client ActivityLogAlertsClient) Get(ctx context.Context, resourceGroupName string, activityLogAlertName string) (result ActivityLogAlertResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActivityLogAlertsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.GetPreparer(ctx, resourceGroupName, activityLogAlertName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Get", nil, "Failure preparing request")
@@ -252,9 +286,19 @@ func (client ActivityLogAlertsClient) GetResponder(resp *http.Response) (result
}
// ListByResourceGroup get a list of all activity log alerts in a resource group.
-//
-// resourceGroupName is the name of the resource group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
func (client ActivityLogAlertsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ActivityLogAlertList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActivityLogAlertsClient.ListByResourceGroup")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "ListByResourceGroup", nil, "Failure preparing request")
@@ -318,6 +362,16 @@ func (client ActivityLogAlertsClient) ListByResourceGroupResponder(resp *http.Re
// ListBySubscriptionID get a list of all activity log alerts in a subscription.
func (client ActivityLogAlertsClient) ListBySubscriptionID(ctx context.Context) (result ActivityLogAlertList, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActivityLogAlertsClient.ListBySubscriptionID")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListBySubscriptionIDPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "ListBySubscriptionID", nil, "Failure preparing request")
@@ -379,10 +433,21 @@ func (client ActivityLogAlertsClient) ListBySubscriptionIDResponder(resp *http.R
}
// Update updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method.
-//
-// resourceGroupName is the name of the resource group. activityLogAlertName is the name of the activity log alert.
-// activityLogAlertPatch is parameters supplied to the operation.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// activityLogAlertName - the name of the activity log alert.
+// activityLogAlertPatch - parameters supplied to the operation.
func (client ActivityLogAlertsClient) Update(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlertPatch ActivityLogAlertPatchBody) (result ActivityLogAlertResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActivityLogAlertsClient.Update")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.UpdatePreparer(ctx, resourceGroupName, activityLogAlertName, activityLogAlertPatch)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.ActivityLogAlertsClient", "Update", nil, "Failure preparing request")
@@ -418,7 +483,7 @@ func (client ActivityLogAlertsClient) UpdatePreparer(ctx context.Context, resour
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}", pathParameters),
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/activitylogs.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/activitylogs.go
new file mode 100644
index 000000000000..92120d847dce
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/activitylogs.go
@@ -0,0 +1,175 @@
+package insights
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// ActivityLogsClient is the monitor Management Client
+type ActivityLogsClient struct {
+ BaseClient
+}
+
+// NewActivityLogsClient creates an instance of the ActivityLogsClient client.
+func NewActivityLogsClient(subscriptionID string) ActivityLogsClient {
+ return NewActivityLogsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewActivityLogsClientWithBaseURI creates an instance of the ActivityLogsClient client.
+func NewActivityLogsClientWithBaseURI(baseURI string, subscriptionID string) ActivityLogsClient {
+ return ActivityLogsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List provides the list of records from the activity logs.
+// Parameters:
+// filter - reduces the set of data collected.
The **$filter** argument is very restricted and allows only
+// the following patterns.
- *List events for a resource group*: $filter=eventTimestamp ge
+// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq
+// 'resourceGroupName'.
- *List events for resource*: $filter=eventTimestamp ge
+// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq
+// 'resourceURI'.
- *List events for a subscription in a time range*: $filter=eventTimestamp ge
+// '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'.
- *List events for a
+// resource provider*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le
+// '2014-07-20T04:36:37.6407898Z' and resourceProvider eq 'resourceProviderName'.
- *List events for a
+// correlation Id*: $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le
+// '2014-07-20T04:36:37.6407898Z' and correlationId eq 'correlationID'.
**NOTE**: No other syntax is
+// allowed.
+// selectParameter - used to fetch events with only the given properties.
The **$select** argument is a
+// comma separated list of property names to be returned. Possible values are: *authorization*, *claims*,
+// *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*,
+// *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*,
+// *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*
+func (client ActivityLogsClient) List(ctx context.Context, filter string, selectParameter string) (result EventDataCollectionPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActivityLogsClient.List")
+ defer func() {
+ sc := -1
+ if result.edc.Response.Response != nil {
+ sc = result.edc.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, filter, selectParameter)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ActivityLogsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.edc.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.ActivityLogsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.edc, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ActivityLogsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client ActivityLogsClient) ListPreparer(ctx context.Context, filter string, selectParameter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2015-04-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/eventtypes/management/values", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client ActivityLogsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client ActivityLogsClient) ListResponder(resp *http.Response) (result EventDataCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client ActivityLogsClient) listNextResults(ctx context.Context, lastResults EventDataCollection) (result EventDataCollection, err error) {
+ req, err := lastResults.eventDataCollectionPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "insights.ActivityLogsClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "insights.ActivityLogsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ActivityLogsClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client ActivityLogsClient) ListComplete(ctx context.Context, filter string, selectParameter string) (result EventDataCollectionIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ActivityLogsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx, filter, selectParameter)
+ return
+}
diff --git a/services/monitor/mgmt/2017-09-01/insights/alertruleincidents.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/alertruleincidents.go
similarity index 89%
rename from services/monitor/mgmt/2017-09-01/insights/alertruleincidents.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/alertruleincidents.go
index f3d8fc8b20ab..71ddce0de4b9 100644
--- a/services/monitor/mgmt/2017-09-01/insights/alertruleincidents.go
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/alertruleincidents.go
@@ -21,6 +21,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -40,10 +41,21 @@ func NewAlertRuleIncidentsClientWithBaseURI(baseURI string, subscriptionID strin
}
// Get gets an incident associated to an alert rule
-//
-// resourceGroupName is the name of the resource group. ruleName is the name of the rule. incidentName is the name
-// of the incident to retrieve.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+// incidentName - the name of the incident to retrieve.
func (client AlertRuleIncidentsClient) Get(ctx context.Context, resourceGroupName string, ruleName string, incidentName string) (result Incident, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AlertRuleIncidentsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.GetPreparer(ctx, resourceGroupName, ruleName, incidentName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsClient", "Get", nil, "Failure preparing request")
@@ -108,9 +120,20 @@ func (client AlertRuleIncidentsClient) GetResponder(resp *http.Response) (result
}
// ListByAlertRule gets a list of incidents associated to an alert rule
-//
-// resourceGroupName is the name of the resource group. ruleName is the name of the rule.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
func (client AlertRuleIncidentsClient) ListByAlertRule(ctx context.Context, resourceGroupName string, ruleName string) (result IncidentListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AlertRuleIncidentsClient.ListByAlertRule")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListByAlertRulePreparer(ctx, resourceGroupName, ruleName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.AlertRuleIncidentsClient", "ListByAlertRule", nil, "Failure preparing request")
diff --git a/services/monitor/mgmt/2017-09-01/insights/alertrules.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/alertrules.go
similarity index 76%
rename from services/monitor/mgmt/2017-09-01/insights/alertrules.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/alertrules.go
index 31d6b5b551f6..4de0da4d9bb4 100644
--- a/services/monitor/mgmt/2017-09-01/insights/alertrules.go
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/alertrules.go
@@ -22,6 +22,7 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -41,10 +42,21 @@ func NewAlertRulesClientWithBaseURI(baseURI string, subscriptionID string) Alert
}
// CreateOrUpdate creates or updates an alert rule.
-//
-// resourceGroupName is the name of the resource group. ruleName is the name of the rule. parameters is the
-// parameters of the rule to create or update.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+// parameters - the parameters of the rule to create or update.
func (client AlertRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters AlertRuleResource) (result AlertRuleResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.AlertRule", Name: validation.Null, Rule: true,
@@ -90,7 +102,7 @@ func (client AlertRulesClient) CreateOrUpdatePreparer(ctx context.Context, resou
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}", pathParameters),
@@ -120,9 +132,20 @@ func (client AlertRulesClient) CreateOrUpdateResponder(resp *http.Response) (res
}
// Delete deletes an alert rule
-//
-// resourceGroupName is the name of the resource group. ruleName is the name of the rule.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
func (client AlertRulesClient) Delete(ctx context.Context, resourceGroupName string, ruleName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.DeletePreparer(ctx, resourceGroupName, ruleName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Delete", nil, "Failure preparing request")
@@ -185,9 +208,20 @@ func (client AlertRulesClient) DeleteResponder(resp *http.Response) (result auto
}
// Get gets an alert rule
-//
-// resourceGroupName is the name of the resource group. ruleName is the name of the rule.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
func (client AlertRulesClient) Get(ctx context.Context, resourceGroupName string, ruleName string) (result AlertRuleResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.GetPreparer(ctx, resourceGroupName, ruleName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Get", nil, "Failure preparing request")
@@ -251,9 +285,19 @@ func (client AlertRulesClient) GetResponder(resp *http.Response) (result AlertRu
}
// ListByResourceGroup list the alert rules within a resource group.
-//
-// resourceGroupName is the name of the resource group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
func (client AlertRulesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AlertRuleResourceCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.ListByResourceGroup")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListByResourceGroup", nil, "Failure preparing request")
@@ -315,11 +359,94 @@ func (client AlertRulesClient) ListByResourceGroupResponder(resp *http.Response)
return
}
+// ListBySubscription list the 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")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListBySubscriptionPreparer(ctx)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListBySubscription", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListBySubscription", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "ListBySubscription", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListBySubscriptionPreparer prepares the ListBySubscription request.
+func (client AlertRulesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2016-03-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/alertrules", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client AlertRulesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
+// closes the http.Response Body.
+func (client AlertRulesClient) ListBySubscriptionResponder(resp *http.Response) (result AlertRuleResourceCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
// Update updates an existing AlertRuleResource. To update other fields use the CreateOrUpdate method.
-//
-// resourceGroupName is the name of the resource group. ruleName is the name of the rule. alertRulesResource is
-// parameters supplied to the operation.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+// alertRulesResource - parameters supplied to the operation.
func (client AlertRulesClient) Update(ctx context.Context, resourceGroupName string, ruleName string, alertRulesResource AlertRuleResourcePatch) (result AlertRuleResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.Update")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.UpdatePreparer(ctx, resourceGroupName, ruleName, alertRulesResource)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.AlertRulesClient", "Update", nil, "Failure preparing request")
@@ -355,7 +482,7 @@ func (client AlertRulesClient) UpdatePreparer(ctx context.Context, resourceGroup
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}", pathParameters),
diff --git a/services/monitor/mgmt/2017-09-01/insights/autoscalesettings.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/autoscalesettings.go
similarity index 70%
rename from services/monitor/mgmt/2017-09-01/insights/autoscalesettings.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/autoscalesettings.go
index 228d77427fb1..dd6a3b0e33d2 100644
--- a/services/monitor/mgmt/2017-09-01/insights/autoscalesettings.go
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/autoscalesettings.go
@@ -22,6 +22,7 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -41,10 +42,21 @@ func NewAutoscaleSettingsClientWithBaseURI(baseURI string, subscriptionID string
}
// CreateOrUpdate creates or updates an autoscale setting.
-//
-// resourceGroupName is the name of the resource group. autoscaleSettingName is the autoscale setting name.
-// parameters is parameters supplied to the operation.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// autoscaleSettingName - the autoscale setting name.
+// parameters - parameters supplied to the operation.
func (client AutoscaleSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, autoscaleSettingName string, parameters AutoscaleSettingResource) (result AutoscaleSettingResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingsClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.AutoscaleSetting", Name: validation.Null, Rule: true,
@@ -89,7 +101,7 @@ func (client AutoscaleSettingsClient) CreateOrUpdatePreparer(ctx context.Context
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}", pathParameters),
@@ -119,9 +131,20 @@ func (client AutoscaleSettingsClient) CreateOrUpdateResponder(resp *http.Respons
}
// Delete deletes and autoscale setting
-//
-// resourceGroupName is the name of the resource group. autoscaleSettingName is the autoscale setting name.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// autoscaleSettingName - the autoscale setting name.
func (client AutoscaleSettingsClient) Delete(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.DeletePreparer(ctx, resourceGroupName, autoscaleSettingName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Delete", nil, "Failure preparing request")
@@ -184,9 +207,20 @@ func (client AutoscaleSettingsClient) DeleteResponder(resp *http.Response) (resu
}
// Get gets an autoscale setting
-//
-// resourceGroupName is the name of the resource group. autoscaleSettingName is the autoscale setting name.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// autoscaleSettingName - the autoscale setting name.
func (client AutoscaleSettingsClient) Get(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (result AutoscaleSettingResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.GetPreparer(ctx, resourceGroupName, autoscaleSettingName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Get", nil, "Failure preparing request")
@@ -250,9 +284,19 @@ func (client AutoscaleSettingsClient) GetResponder(resp *http.Response) (result
}
// ListByResourceGroup lists the autoscale settings for a resource group
-//
-// resourceGroupName is the name of the resource group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
func (client AutoscaleSettingsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AutoscaleSettingResourceCollectionPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingsClient.ListByResourceGroup")
+ defer func() {
+ sc := -1
+ if result.asrc.Response.Response != nil {
+ sc = result.asrc.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
result.fn = client.listByResourceGroupNextResults
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
if err != nil {
@@ -316,8 +360,8 @@ func (client AutoscaleSettingsClient) ListByResourceGroupResponder(resp *http.Re
}
// listByResourceGroupNextResults retrieves the next set of results, if any.
-func (client AutoscaleSettingsClient) listByResourceGroupNextResults(lastResults AutoscaleSettingResourceCollection) (result AutoscaleSettingResourceCollection, err error) {
- req, err := lastResults.autoscaleSettingResourceCollectionPreparer()
+func (client AutoscaleSettingsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AutoscaleSettingResourceCollection) (result AutoscaleSettingResourceCollection, err error) {
+ req, err := lastResults.autoscaleSettingResourceCollectionPreparer(ctx)
if err != nil {
return result, autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
}
@@ -338,15 +382,146 @@ func (client AutoscaleSettingsClient) listByResourceGroupNextResults(lastResults
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
func (client AutoscaleSettingsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AutoscaleSettingResourceCollectionIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingsClient.ListByResourceGroup")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
return
}
+// ListBySubscription lists the autoscale settings for a subscription
+func (client AutoscaleSettingsClient) ListBySubscription(ctx context.Context) (result AutoscaleSettingResourceCollectionPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingsClient.ListBySubscription")
+ defer func() {
+ sc := -1
+ if result.asrc.Response.Response != nil {
+ sc = result.asrc.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listBySubscriptionNextResults
+ req, err := client.ListBySubscriptionPreparer(ctx)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListBySubscription", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.asrc.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListBySubscription", resp, "Failure sending request")
+ return
+ }
+
+ result.asrc, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "ListBySubscription", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListBySubscriptionPreparer prepares the ListBySubscription request.
+func (client AutoscaleSettingsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2015-04-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/autoscalesettings", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client AutoscaleSettingsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
+// closes the http.Response Body.
+func (client AutoscaleSettingsClient) ListBySubscriptionResponder(resp *http.Response) (result AutoscaleSettingResourceCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listBySubscriptionNextResults retrieves the next set of results, if any.
+func (client AutoscaleSettingsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AutoscaleSettingResourceCollection) (result AutoscaleSettingResourceCollection, err error) {
+ req, err := lastResults.autoscaleSettingResourceCollectionPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
+func (client AutoscaleSettingsClient) ListBySubscriptionComplete(ctx context.Context) (result AutoscaleSettingResourceCollectionIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingsClient.ListBySubscription")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.ListBySubscription(ctx)
+ return
+}
+
// Update updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method.
-//
-// resourceGroupName is the name of the resource group. autoscaleSettingName is the autoscale setting name.
-// autoscaleSettingResource is parameters supplied to the operation.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// autoscaleSettingName - the autoscale setting name.
+// autoscaleSettingResource - parameters supplied to the operation.
func (client AutoscaleSettingsClient) Update(ctx context.Context, resourceGroupName string, autoscaleSettingName string, autoscaleSettingResource AutoscaleSettingResourcePatch) (result AutoscaleSettingResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingsClient.Update")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.UpdatePreparer(ctx, resourceGroupName, autoscaleSettingName, autoscaleSettingResource)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.AutoscaleSettingsClient", "Update", nil, "Failure preparing request")
@@ -382,7 +557,7 @@ func (client AutoscaleSettingsClient) UpdatePreparer(ctx context.Context, resour
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}", pathParameters),
diff --git a/services/monitor/mgmt/2017-09-01/insights/client.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/client.go
similarity index 100%
rename from services/monitor/mgmt/2017-09-01/insights/client.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/client.go
diff --git a/services/monitor/mgmt/2017-09-01/insights/diagnosticsettings.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/diagnosticsettings.go
similarity index 88%
rename from services/monitor/mgmt/2017-09-01/insights/diagnosticsettings.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/diagnosticsettings.go
index 8f8861902667..441f65a391a1 100644
--- a/services/monitor/mgmt/2017-09-01/insights/diagnosticsettings.go
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/diagnosticsettings.go
@@ -21,6 +21,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -40,10 +41,21 @@ func NewDiagnosticSettingsClientWithBaseURI(baseURI string, subscriptionID strin
}
// CreateOrUpdate creates or updates diagnostic settings for the specified resource.
-//
-// resourceURI is the identifier of the resource. parameters is parameters supplied to the operation. name is the
-// name of the diagnostic setting.
+// Parameters:
+// resourceURI - the identifier of the resource.
+// parameters - parameters supplied to the operation.
+// name - the name of the diagnostic setting.
func (client DiagnosticSettingsClient) CreateOrUpdate(ctx context.Context, resourceURI string, parameters DiagnosticSettingsResource, name string) (result DiagnosticSettingsResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticSettingsClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.CreateOrUpdatePreparer(ctx, resourceURI, parameters, name)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "CreateOrUpdate", nil, "Failure preparing request")
@@ -78,7 +90,7 @@ func (client DiagnosticSettingsClient) CreateOrUpdatePreparer(ctx context.Contex
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}", pathParameters),
@@ -108,9 +120,20 @@ func (client DiagnosticSettingsClient) CreateOrUpdateResponder(resp *http.Respon
}
// Delete deletes existing diagnostic settings for the specified resource.
-//
-// resourceURI is the identifier of the resource. name is the name of the diagnostic setting.
+// Parameters:
+// resourceURI - the identifier of the resource.
+// name - the name of the diagnostic setting.
func (client DiagnosticSettingsClient) Delete(ctx context.Context, resourceURI string, name string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticSettingsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.DeletePreparer(ctx, resourceURI, name)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "Delete", nil, "Failure preparing request")
@@ -172,9 +195,20 @@ func (client DiagnosticSettingsClient) DeleteResponder(resp *http.Response) (res
}
// Get gets the active diagnostic settings for the specified resource.
-//
-// resourceURI is the identifier of the resource. name is the name of the diagnostic setting.
+// Parameters:
+// resourceURI - the identifier of the resource.
+// name - the name of the diagnostic setting.
func (client DiagnosticSettingsClient) Get(ctx context.Context, resourceURI string, name string) (result DiagnosticSettingsResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticSettingsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.GetPreparer(ctx, resourceURI, name)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "Get", nil, "Failure preparing request")
@@ -237,9 +271,19 @@ func (client DiagnosticSettingsClient) GetResponder(resp *http.Response) (result
}
// List gets the active diagnostic settings list for the specified resource.
-//
-// resourceURI is the identifier of the resource.
+// Parameters:
+// resourceURI - the identifier of the resource.
func (client DiagnosticSettingsClient) List(ctx context.Context, resourceURI string) (result DiagnosticSettingsResourceCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticSettingsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListPreparer(ctx, resourceURI)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsClient", "List", nil, "Failure preparing request")
diff --git a/services/monitor/mgmt/2017-09-01/insights/diagnosticsettingscategory.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/diagnosticsettingscategory.go
similarity index 89%
rename from services/monitor/mgmt/2017-09-01/insights/diagnosticsettingscategory.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/diagnosticsettingscategory.go
index 538f52abdfe8..724253f35b7e 100644
--- a/services/monitor/mgmt/2017-09-01/insights/diagnosticsettingscategory.go
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/diagnosticsettingscategory.go
@@ -21,6 +21,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -40,9 +41,20 @@ func NewDiagnosticSettingsCategoryClientWithBaseURI(baseURI string, subscription
}
// Get gets the diagnostic settings category for the specified resource.
-//
-// resourceURI is the identifier of the resource. name is the name of the diagnostic setting.
+// Parameters:
+// resourceURI - the identifier of the resource.
+// name - the name of the diagnostic setting.
func (client DiagnosticSettingsCategoryClient) Get(ctx context.Context, resourceURI string, name string) (result DiagnosticSettingsCategoryResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticSettingsCategoryClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.GetPreparer(ctx, resourceURI, name)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryClient", "Get", nil, "Failure preparing request")
@@ -105,9 +117,19 @@ func (client DiagnosticSettingsCategoryClient) GetResponder(resp *http.Response)
}
// List lists the diagnostic settings categories for the specified resource.
-//
-// resourceURI is the identifier of the resource.
+// Parameters:
+// resourceURI - the identifier of the resource.
func (client DiagnosticSettingsCategoryClient) List(ctx context.Context, resourceURI string) (result DiagnosticSettingsCategoryResourceCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticSettingsCategoryClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListPreparer(ctx, resourceURI)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.DiagnosticSettingsCategoryClient", "List", nil, "Failure preparing request")
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/eventcategories.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/eventcategories.go
new file mode 100644
index 000000000000..ed5854d8f49a
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/eventcategories.go
@@ -0,0 +1,110 @@
+package insights
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// EventCategoriesClient is the monitor Management Client
+type EventCategoriesClient struct {
+ BaseClient
+}
+
+// NewEventCategoriesClient creates an instance of the EventCategoriesClient client.
+func NewEventCategoriesClient(subscriptionID string) EventCategoriesClient {
+ return NewEventCategoriesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewEventCategoriesClientWithBaseURI creates an instance of the EventCategoriesClient client.
+func NewEventCategoriesClientWithBaseURI(baseURI string, subscriptionID string) EventCategoriesClient {
+ return EventCategoriesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List get the list of available event categories supported in the Activity Logs Service.
The current list includes
+// the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy.
+func (client EventCategoriesClient) List(ctx context.Context) (result EventCategoryCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/EventCategoriesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListPreparer(ctx)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.EventCategoriesClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.EventCategoriesClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.EventCategoriesClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client EventCategoriesClient) ListPreparer(ctx context.Context) (*http.Request, error) {
+ const APIVersion = "2015-04-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/providers/microsoft.insights/eventcategories"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client EventCategoriesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client EventCategoriesClient) ListResponder(resp *http.Response) (result EventCategoryCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/insightsapi/interfaces.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/insightsapi/interfaces.go
new file mode 100644
index 000000000000..b7de393f7130
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/insightsapi/interfaces.go
@@ -0,0 +1,206 @@
+package insightsapi
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-11-01-preview/insights"
+ "github.com/Azure/go-autorest/autorest"
+)
+
+// AutoscaleSettingsClientAPI contains the set of methods on the AutoscaleSettingsClient type.
+type AutoscaleSettingsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, resourceGroupName string, autoscaleSettingName string, parameters insights.AutoscaleSettingResource) (result insights.AutoscaleSettingResource, err error)
+ Delete(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (result autorest.Response, err error)
+ Get(ctx context.Context, resourceGroupName string, autoscaleSettingName string) (result insights.AutoscaleSettingResource, err error)
+ ListByResourceGroup(ctx context.Context, resourceGroupName string) (result insights.AutoscaleSettingResourceCollectionPage, err error)
+ ListBySubscription(ctx context.Context) (result insights.AutoscaleSettingResourceCollectionPage, err error)
+ Update(ctx context.Context, resourceGroupName string, autoscaleSettingName string, autoscaleSettingResource insights.AutoscaleSettingResourcePatch) (result insights.AutoscaleSettingResource, err error)
+}
+
+var _ AutoscaleSettingsClientAPI = (*insights.AutoscaleSettingsClient)(nil)
+
+// OperationsClientAPI contains the set of methods on the OperationsClient type.
+type OperationsClientAPI interface {
+ List(ctx context.Context) (result insights.OperationListResult, err error)
+}
+
+var _ OperationsClientAPI = (*insights.OperationsClient)(nil)
+
+// AlertRuleIncidentsClientAPI contains the set of methods on the AlertRuleIncidentsClient type.
+type AlertRuleIncidentsClientAPI interface {
+ Get(ctx context.Context, resourceGroupName string, ruleName string, incidentName string) (result insights.Incident, err error)
+ ListByAlertRule(ctx context.Context, resourceGroupName string, ruleName string) (result insights.IncidentListResult, err error)
+}
+
+var _ AlertRuleIncidentsClientAPI = (*insights.AlertRuleIncidentsClient)(nil)
+
+// AlertRulesClientAPI contains the set of methods on the AlertRulesClient type.
+type AlertRulesClientAPI interface {
+ CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters insights.AlertRuleResource) (result insights.AlertRuleResource, err error)
+ Delete(ctx context.Context, resourceGroupName string, ruleName string) (result autorest.Response, err error)
+ Get(ctx context.Context, resourceGroupName string, ruleName string) (result insights.AlertRuleResource, err error)
+ ListByResourceGroup(ctx context.Context, resourceGroupName string) (result insights.AlertRuleResourceCollection, err error)
+ ListBySubscription(ctx context.Context) (result insights.AlertRuleResourceCollection, err error)
+ Update(ctx context.Context, resourceGroupName string, ruleName string, alertRulesResource insights.AlertRuleResourcePatch) (result insights.AlertRuleResource, err error)
+}
+
+var _ AlertRulesClientAPI = (*insights.AlertRulesClient)(nil)
+
+// LogProfilesClientAPI contains the set of methods on the LogProfilesClient type.
+type LogProfilesClientAPI interface {
+ CreateOrUpdate(ctx context.Context, logProfileName string, parameters insights.LogProfileResource) (result insights.LogProfileResource, err error)
+ Delete(ctx context.Context, logProfileName string) (result autorest.Response, err error)
+ Get(ctx context.Context, logProfileName string) (result insights.LogProfileResource, err error)
+ List(ctx context.Context) (result insights.LogProfileCollection, err error)
+ Update(ctx context.Context, logProfileName string, logProfilesResource insights.LogProfileResourcePatch) (result insights.LogProfileResource, err error)
+}
+
+var _ LogProfilesClientAPI = (*insights.LogProfilesClient)(nil)
+
+// DiagnosticSettingsClientAPI contains the set of methods on the DiagnosticSettingsClient type.
+type DiagnosticSettingsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, resourceURI string, parameters insights.DiagnosticSettingsResource, name string) (result insights.DiagnosticSettingsResource, err error)
+ Delete(ctx context.Context, resourceURI string, name string) (result autorest.Response, err error)
+ Get(ctx context.Context, resourceURI string, name string) (result insights.DiagnosticSettingsResource, err error)
+ List(ctx context.Context, resourceURI string) (result insights.DiagnosticSettingsResourceCollection, err error)
+}
+
+var _ DiagnosticSettingsClientAPI = (*insights.DiagnosticSettingsClient)(nil)
+
+// DiagnosticSettingsCategoryClientAPI contains the set of methods on the DiagnosticSettingsCategoryClient type.
+type DiagnosticSettingsCategoryClientAPI interface {
+ Get(ctx context.Context, resourceURI string, name string) (result insights.DiagnosticSettingsCategoryResource, err error)
+ List(ctx context.Context, resourceURI string) (result insights.DiagnosticSettingsCategoryResourceCollection, err error)
+}
+
+var _ DiagnosticSettingsCategoryClientAPI = (*insights.DiagnosticSettingsCategoryClient)(nil)
+
+// ActionGroupsClientAPI contains the set of methods on the ActionGroupsClient type.
+type ActionGroupsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroup insights.ActionGroupResource) (result insights.ActionGroupResource, err error)
+ Delete(ctx context.Context, resourceGroupName string, actionGroupName string) (result autorest.Response, err error)
+ EnableReceiver(ctx context.Context, resourceGroupName string, actionGroupName string, enableRequest insights.EnableRequest) (result autorest.Response, err error)
+ Get(ctx context.Context, resourceGroupName string, actionGroupName string) (result insights.ActionGroupResource, err error)
+ ListByResourceGroup(ctx context.Context, resourceGroupName string) (result insights.ActionGroupList, err error)
+ ListBySubscriptionID(ctx context.Context) (result insights.ActionGroupList, err error)
+ Update(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroupPatch insights.ActionGroupPatchBody) (result insights.ActionGroupResource, err error)
+}
+
+var _ ActionGroupsClientAPI = (*insights.ActionGroupsClient)(nil)
+
+// ActivityLogAlertsClientAPI contains the set of methods on the ActivityLogAlertsClient type.
+type ActivityLogAlertsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlert insights.ActivityLogAlertResource) (result insights.ActivityLogAlertResource, err error)
+ Delete(ctx context.Context, resourceGroupName string, activityLogAlertName string) (result autorest.Response, err error)
+ Get(ctx context.Context, resourceGroupName string, activityLogAlertName string) (result insights.ActivityLogAlertResource, err error)
+ ListByResourceGroup(ctx context.Context, resourceGroupName string) (result insights.ActivityLogAlertList, err error)
+ ListBySubscriptionID(ctx context.Context) (result insights.ActivityLogAlertList, err error)
+ Update(ctx context.Context, resourceGroupName string, activityLogAlertName string, activityLogAlertPatch insights.ActivityLogAlertPatchBody) (result insights.ActivityLogAlertResource, err error)
+}
+
+var _ ActivityLogAlertsClientAPI = (*insights.ActivityLogAlertsClient)(nil)
+
+// ActivityLogsClientAPI contains the set of methods on the ActivityLogsClient type.
+type ActivityLogsClientAPI interface {
+ List(ctx context.Context, filter string, selectParameter string) (result insights.EventDataCollectionPage, err error)
+}
+
+var _ ActivityLogsClientAPI = (*insights.ActivityLogsClient)(nil)
+
+// EventCategoriesClientAPI contains the set of methods on the EventCategoriesClient type.
+type EventCategoriesClientAPI interface {
+ List(ctx context.Context) (result insights.EventCategoryCollection, err error)
+}
+
+var _ EventCategoriesClientAPI = (*insights.EventCategoriesClient)(nil)
+
+// TenantActivityLogsClientAPI contains the set of methods on the TenantActivityLogsClient type.
+type TenantActivityLogsClientAPI interface {
+ List(ctx context.Context, filter string, selectParameter string) (result insights.EventDataCollectionPage, err error)
+}
+
+var _ TenantActivityLogsClientAPI = (*insights.TenantActivityLogsClient)(nil)
+
+// MetricDefinitionsClientAPI contains the set of methods on the MetricDefinitionsClient type.
+type MetricDefinitionsClientAPI interface {
+ List(ctx context.Context, resourceURI string, metricnamespace string) (result insights.MetricDefinitionCollection, err error)
+}
+
+var _ MetricDefinitionsClientAPI = (*insights.MetricDefinitionsClient)(nil)
+
+// MetricsClientAPI contains the set of methods on the MetricsClient type.
+type MetricsClientAPI interface {
+ List(ctx context.Context, resourceURI string, timespan string, interval *string, metricnames string, aggregation string, top *int32, orderby string, filter string, resultType insights.ResultType, metricnamespace string) (result insights.Response, err error)
+}
+
+var _ MetricsClientAPI = (*insights.MetricsClient)(nil)
+
+// MetricBaselineClientAPI contains the set of methods on the MetricBaselineClient type.
+type MetricBaselineClientAPI interface {
+ CalculateBaseline(ctx context.Context, resourceURI string, timeSeriesInformation insights.TimeSeriesInformation) (result insights.CalculateBaselineResponse, err error)
+ Get(ctx context.Context, resourceURI string, metricName string, timespan string, interval *string, aggregation string, sensitivities string, resultType insights.ResultType) (result insights.BaselineResponse, err error)
+}
+
+var _ MetricBaselineClientAPI = (*insights.MetricBaselineClient)(nil)
+
+// MetricAlertsClientAPI contains the set of methods on the MetricAlertsClient type.
+type MetricAlertsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters insights.MetricAlertResource) (result insights.MetricAlertResource, err error)
+ Delete(ctx context.Context, resourceGroupName string, ruleName string) (result autorest.Response, err error)
+ Get(ctx context.Context, resourceGroupName string, ruleName string) (result insights.MetricAlertResource, err error)
+ ListByResourceGroup(ctx context.Context, resourceGroupName string) (result insights.MetricAlertResourceCollection, err error)
+ ListBySubscription(ctx context.Context) (result insights.MetricAlertResourceCollection, err error)
+ Update(ctx context.Context, resourceGroupName string, ruleName string, parameters insights.MetricAlertResourcePatch) (result insights.MetricAlertResource, err error)
+}
+
+var _ MetricAlertsClientAPI = (*insights.MetricAlertsClient)(nil)
+
+// MetricAlertsStatusClientAPI contains the set of methods on the MetricAlertsStatusClient type.
+type MetricAlertsStatusClientAPI interface {
+ List(ctx context.Context, resourceGroupName string, ruleName string) (result insights.MetricAlertStatusCollection, err error)
+ ListByName(ctx context.Context, resourceGroupName string, ruleName string, statusName string) (result insights.MetricAlertStatusCollection, err error)
+}
+
+var _ MetricAlertsStatusClientAPI = (*insights.MetricAlertsStatusClient)(nil)
+
+// ScheduledQueryRulesClientAPI contains the set of methods on the ScheduledQueryRulesClient type.
+type ScheduledQueryRulesClientAPI interface {
+ CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters insights.LogSearchRuleResource) (result insights.LogSearchRuleResource, err error)
+ Delete(ctx context.Context, resourceGroupName string, ruleName string) (result autorest.Response, err error)
+ Get(ctx context.Context, resourceGroupName string, ruleName string) (result insights.LogSearchRuleResource, err error)
+ ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result insights.LogSearchRuleResourceCollection, err error)
+ ListBySubscription(ctx context.Context, filter string) (result insights.LogSearchRuleResourceCollection, err error)
+ Update(ctx context.Context, resourceGroupName string, ruleName string, parameters insights.LogSearchRuleResourcePatch) (result insights.LogSearchRuleResource, err error)
+}
+
+var _ ScheduledQueryRulesClientAPI = (*insights.ScheduledQueryRulesClient)(nil)
+
+// MetricNamespacesClientAPI contains the set of methods on the MetricNamespacesClient type.
+type MetricNamespacesClientAPI interface {
+ List(ctx context.Context, resourceURI string, startTime string) (result insights.MetricNamespaceCollection, err error)
+}
+
+var _ MetricNamespacesClientAPI = (*insights.MetricNamespacesClient)(nil)
+
+// VMInsightsClientAPI contains the set of methods on the VMInsightsClient type.
+type VMInsightsClientAPI interface {
+ GetOnboardingStatus(ctx context.Context, resourceURI string) (result insights.VMInsightsOnboardingStatus, err error)
+}
+
+var _ VMInsightsClientAPI = (*insights.VMInsightsClient)(nil)
diff --git a/services/monitor/mgmt/2017-09-01/insights/logprofiles.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/logprofiles.go
similarity index 89%
rename from services/monitor/mgmt/2017-09-01/insights/logprofiles.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/logprofiles.go
index 95a9cb0ec03f..442bc2f213cd 100644
--- a/services/monitor/mgmt/2017-09-01/insights/logprofiles.go
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/logprofiles.go
@@ -22,6 +22,7 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -41,9 +42,20 @@ func NewLogProfilesClientWithBaseURI(baseURI string, subscriptionID string) LogP
}
// CreateOrUpdate create or update a log profile in Azure Monitoring REST API.
-//
-// logProfileName is the name of the log profile. parameters is parameters supplied to the operation.
+// Parameters:
+// logProfileName - the name of the log profile.
+// parameters - parameters supplied to the operation.
func (client LogProfilesClient) CreateOrUpdate(ctx context.Context, logProfileName string, parameters LogProfileResource) (result LogProfileResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/LogProfilesClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.LogProfileProperties", Name: validation.Null, Rule: true,
@@ -92,7 +104,7 @@ func (client LogProfilesClient) CreateOrUpdatePreparer(ctx context.Context, logP
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}", pathParameters),
@@ -122,9 +134,19 @@ func (client LogProfilesClient) CreateOrUpdateResponder(resp *http.Response) (re
}
// Delete deletes the log profile.
-//
-// logProfileName is the name of the log profile.
+// Parameters:
+// logProfileName - the name of the log profile.
func (client LogProfilesClient) Delete(ctx context.Context, logProfileName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/LogProfilesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.DeletePreparer(ctx, logProfileName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Delete", nil, "Failure preparing request")
@@ -186,9 +208,19 @@ func (client LogProfilesClient) DeleteResponder(resp *http.Response) (result aut
}
// Get gets the log profile.
-//
-// logProfileName is the name of the log profile.
+// Parameters:
+// logProfileName - the name of the log profile.
func (client LogProfilesClient) Get(ctx context.Context, logProfileName string) (result LogProfileResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/LogProfilesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.GetPreparer(ctx, logProfileName)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Get", nil, "Failure preparing request")
@@ -252,6 +284,16 @@ func (client LogProfilesClient) GetResponder(resp *http.Response) (result LogPro
// List list the log profiles.
func (client LogProfilesClient) List(ctx context.Context) (result LogProfileCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/LogProfilesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "List", nil, "Failure preparing request")
@@ -313,9 +355,20 @@ func (client LogProfilesClient) ListResponder(resp *http.Response) (result LogPr
}
// Update updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method.
-//
-// logProfileName is the name of the log profile. logProfilesResource is parameters supplied to the operation.
+// Parameters:
+// logProfileName - the name of the log profile.
+// logProfilesResource - parameters supplied to the operation.
func (client LogProfilesClient) Update(ctx context.Context, logProfileName string, logProfilesResource LogProfileResourcePatch) (result LogProfileResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/LogProfilesClient.Update")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.UpdatePreparer(ctx, logProfileName, logProfilesResource)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.LogProfilesClient", "Update", nil, "Failure preparing request")
@@ -350,7 +403,7 @@ func (client LogProfilesClient) UpdatePreparer(ctx context.Context, logProfileNa
}
preparer := autorest.CreatePreparer(
- autorest.AsJSON(),
+ autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}", pathParameters),
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricalerts.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricalerts.go
new file mode 100644
index 000000000000..240ac032e593
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricalerts.go
@@ -0,0 +1,515 @@
+package insights
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// MetricAlertsClient is the monitor Management Client
+type MetricAlertsClient struct {
+ BaseClient
+}
+
+// NewMetricAlertsClient creates an instance of the MetricAlertsClient client.
+func NewMetricAlertsClient(subscriptionID string) MetricAlertsClient {
+ return NewMetricAlertsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewMetricAlertsClientWithBaseURI creates an instance of the MetricAlertsClient client.
+func NewMetricAlertsClientWithBaseURI(baseURI string, subscriptionID string) MetricAlertsClient {
+ return MetricAlertsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate create or update an metric alert definition.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+// parameters - the parameters of the rule to create or update.
+func (client MetricAlertsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters MetricAlertResource) (result MetricAlertResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricAlertsClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: parameters,
+ Constraints: []validation.Constraint{{Target: "parameters.MetricAlertProperties", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "parameters.MetricAlertProperties.Description", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "parameters.MetricAlertProperties.Severity", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "parameters.MetricAlertProperties.Enabled", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "parameters.MetricAlertProperties.EvaluationFrequency", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "parameters.MetricAlertProperties.WindowSize", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "parameters.MetricAlertProperties.Criteria", Name: validation.Null, Rule: true, Chain: nil},
+ }}}}}); err != nil {
+ return result, validation.NewError("insights.MetricAlertsClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ruleName, parameters)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "CreateOrUpdate", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client MetricAlertsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ruleName string, parameters MetricAlertResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "ruleName": autorest.Encode("path", ruleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-03-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricAlertsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client MetricAlertsClient) CreateOrUpdateResponder(resp *http.Response) (result MetricAlertResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete delete an alert rule definition.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+func (client MetricAlertsClient) Delete(ctx context.Context, resourceGroupName string, ruleName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricAlertsClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.DeletePreparer(ctx, resourceGroupName, ruleName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "Delete", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client MetricAlertsClient) DeletePreparer(ctx context.Context, resourceGroupName string, ruleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "ruleName": autorest.Encode("path", ruleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-03-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricAlertsClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client MetricAlertsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get retrieve an alert rule definition.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+func (client MetricAlertsClient) Get(ctx context.Context, resourceGroupName string, ruleName string) (result MetricAlertResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricAlertsClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetPreparer(ctx, resourceGroupName, ruleName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client MetricAlertsClient) GetPreparer(ctx context.Context, resourceGroupName string, ruleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "ruleName": autorest.Encode("path", ruleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-03-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricAlertsClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client MetricAlertsClient) GetResponder(resp *http.Response) (result MetricAlertResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByResourceGroup retrieve alert rule definitions in a resource group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+func (client MetricAlertsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result MetricAlertResourceCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricAlertsClient.ListByResourceGroup")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "ListByResourceGroup", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "ListByResourceGroup", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "ListByResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
+func (client MetricAlertsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-03-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricAlertsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
+// closes the http.Response Body.
+func (client MetricAlertsClient) ListByResourceGroupResponder(resp *http.Response) (result MetricAlertResourceCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListBySubscription retrieve alert rule definitions in a subscription.
+func (client MetricAlertsClient) ListBySubscription(ctx context.Context) (result MetricAlertResourceCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricAlertsClient.ListBySubscription")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListBySubscriptionPreparer(ctx)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "ListBySubscription", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "ListBySubscription", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "ListBySubscription", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListBySubscriptionPreparer prepares the ListBySubscription request.
+func (client MetricAlertsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-03-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Insights/metricAlerts", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricAlertsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
+// closes the http.Response Body.
+func (client MetricAlertsClient) ListBySubscriptionResponder(resp *http.Response) (result MetricAlertResourceCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update update an metric alert definition.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+// parameters - the parameters of the rule to update.
+func (client MetricAlertsClient) Update(ctx context.Context, resourceGroupName string, ruleName string, parameters MetricAlertResourcePatch) (result MetricAlertResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricAlertsClient.Update")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.UpdatePreparer(ctx, resourceGroupName, ruleName, parameters)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "Update", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client MetricAlertsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, ruleName string, parameters MetricAlertResourcePatch) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "ruleName": autorest.Encode("path", ruleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-03-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricAlertsClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client MetricAlertsClient) UpdateResponder(resp *http.Response) (result MetricAlertResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricalertsstatus.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricalertsstatus.go
new file mode 100644
index 000000000000..389ce69d7cd1
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricalertsstatus.go
@@ -0,0 +1,197 @@
+package insights
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// MetricAlertsStatusClient is the monitor Management Client
+type MetricAlertsStatusClient struct {
+ BaseClient
+}
+
+// NewMetricAlertsStatusClient creates an instance of the MetricAlertsStatusClient client.
+func NewMetricAlertsStatusClient(subscriptionID string) MetricAlertsStatusClient {
+ return NewMetricAlertsStatusClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewMetricAlertsStatusClientWithBaseURI creates an instance of the MetricAlertsStatusClient client.
+func NewMetricAlertsStatusClientWithBaseURI(baseURI string, subscriptionID string) MetricAlertsStatusClient {
+ return MetricAlertsStatusClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List retrieve an alert rule status.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+func (client MetricAlertsStatusClient) List(ctx context.Context, resourceGroupName string, ruleName string) (result MetricAlertStatusCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricAlertsStatusClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListPreparer(ctx, resourceGroupName, ruleName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsStatusClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsStatusClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsStatusClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client MetricAlertsStatusClient) ListPreparer(ctx context.Context, resourceGroupName string, ruleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "ruleName": autorest.Encode("path", ruleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-03-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricAlertsStatusClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client MetricAlertsStatusClient) ListResponder(resp *http.Response) (result MetricAlertStatusCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByName retrieve an alert rule status.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+// statusName - the name of the status.
+func (client MetricAlertsStatusClient) ListByName(ctx context.Context, resourceGroupName string, ruleName string, statusName string) (result MetricAlertStatusCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricAlertsStatusClient.ListByName")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListByNamePreparer(ctx, resourceGroupName, ruleName, statusName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsStatusClient", "ListByName", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListByNameSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsStatusClient", "ListByName", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByNameResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricAlertsStatusClient", "ListByName", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByNamePreparer prepares the ListByName request.
+func (client MetricAlertsStatusClient) ListByNamePreparer(ctx context.Context, resourceGroupName string, ruleName string, statusName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "ruleName": autorest.Encode("path", ruleName),
+ "statusName": autorest.Encode("path", statusName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-03-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/metricAlerts/{ruleName}/status/{statusName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListByNameSender sends the ListByName request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricAlertsStatusClient) ListByNameSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListByNameResponder handles the response to the ListByName request. The method always
+// closes the http.Response Body.
+func (client MetricAlertsStatusClient) ListByNameResponder(resp *http.Response) (result MetricAlertStatusCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricbaseline.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricbaseline.go
new file mode 100644
index 000000000000..43042eacb376
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricbaseline.go
@@ -0,0 +1,229 @@
+package insights
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// MetricBaselineClient is the monitor Management Client
+type MetricBaselineClient struct {
+ BaseClient
+}
+
+// NewMetricBaselineClient creates an instance of the MetricBaselineClient client.
+func NewMetricBaselineClient(subscriptionID string) MetricBaselineClient {
+ return NewMetricBaselineClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewMetricBaselineClientWithBaseURI creates an instance of the MetricBaselineClient client.
+func NewMetricBaselineClientWithBaseURI(baseURI string, subscriptionID string) MetricBaselineClient {
+ return MetricBaselineClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CalculateBaseline **Lists the baseline values for a resource**.
+// Parameters:
+// resourceURI - the identifier of the resource. It has the following structure:
+// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
+// For example:
+// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
+// timeSeriesInformation - information that need to be specified to calculate a baseline on a time series.
+func (client MetricBaselineClient) CalculateBaseline(ctx context.Context, resourceURI string, timeSeriesInformation TimeSeriesInformation) (result CalculateBaselineResponse, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricBaselineClient.CalculateBaseline")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: timeSeriesInformation,
+ Constraints: []validation.Constraint{{Target: "timeSeriesInformation.Sensitivities", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "timeSeriesInformation.Values", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("insights.MetricBaselineClient", "CalculateBaseline", err.Error())
+ }
+
+ req, err := client.CalculateBaselinePreparer(ctx, resourceURI, timeSeriesInformation)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricBaselineClient", "CalculateBaseline", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CalculateBaselineSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricBaselineClient", "CalculateBaseline", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CalculateBaselineResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricBaselineClient", "CalculateBaseline", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CalculateBaselinePreparer prepares the CalculateBaseline request.
+func (client MetricBaselineClient) CalculateBaselinePreparer(ctx context.Context, resourceURI string, timeSeriesInformation TimeSeriesInformation) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceUri": resourceURI,
+ }
+
+ const APIVersion = "2017-11-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{resourceUri}/providers/microsoft.insights/calculatebaseline", pathParameters),
+ autorest.WithJSON(timeSeriesInformation),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CalculateBaselineSender sends the CalculateBaseline request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricBaselineClient) CalculateBaselineSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+}
+
+// CalculateBaselineResponder handles the response to the CalculateBaseline request. The method always
+// closes the http.Response Body.
+func (client MetricBaselineClient) CalculateBaselineResponder(resp *http.Response) (result CalculateBaselineResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Get **Gets the baseline values for a specific metric**.
+// Parameters:
+// resourceURI - the identifier of the resource. It has the following structure:
+// subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
+// For example:
+// subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
+// metricName - the name of the metric to retrieve the baseline for.
+// timespan - the timespan of the query. It is a string with the following format
+// 'startDateTime_ISO/endDateTime_ISO'.
+// interval - the interval (i.e. timegrain) of the query.
+// aggregation - the aggregation type of the metric to retrieve the baseline for.
+// sensitivities - the list of sensitivities (comma separated) to retrieve.
+// resultType - allows retrieving only metadata of the baseline. On data request all information is retrieved.
+func (client MetricBaselineClient) Get(ctx context.Context, resourceURI string, metricName string, timespan string, interval *string, aggregation string, sensitivities string, resultType ResultType) (result BaselineResponse, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricBaselineClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetPreparer(ctx, resourceURI, metricName, timespan, interval, aggregation, sensitivities, resultType)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricBaselineClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricBaselineClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricBaselineClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client MetricBaselineClient) GetPreparer(ctx context.Context, resourceURI string, metricName string, timespan string, interval *string, aggregation string, sensitivities string, resultType ResultType) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "metricName": autorest.Encode("path", metricName),
+ "resourceUri": resourceURI,
+ }
+
+ const APIVersion = "2017-11-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if len(timespan) > 0 {
+ queryParameters["timespan"] = autorest.Encode("query", timespan)
+ }
+ if interval != nil {
+ queryParameters["interval"] = autorest.Encode("query", *interval)
+ }
+ if len(aggregation) > 0 {
+ queryParameters["aggregation"] = autorest.Encode("query", aggregation)
+ }
+ if len(sensitivities) > 0 {
+ queryParameters["sensitivities"] = autorest.Encode("query", sensitivities)
+ }
+ if len(string(resultType)) > 0 {
+ queryParameters["resultType"] = autorest.Encode("query", resultType)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{resourceUri}/providers/microsoft.insights/baseline/{metricName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricBaselineClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client MetricBaselineClient) GetResponder(resp *http.Response) (result BaselineResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricdefinitions.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricdefinitions.go
new file mode 100644
index 000000000000..289abe939a34
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricdefinitions.go
@@ -0,0 +1,119 @@
+package insights
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// MetricDefinitionsClient is the monitor Management Client
+type MetricDefinitionsClient struct {
+ BaseClient
+}
+
+// NewMetricDefinitionsClient creates an instance of the MetricDefinitionsClient client.
+func NewMetricDefinitionsClient(subscriptionID string) MetricDefinitionsClient {
+ return NewMetricDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewMetricDefinitionsClientWithBaseURI creates an instance of the MetricDefinitionsClient client.
+func NewMetricDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) MetricDefinitionsClient {
+ return MetricDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List lists the metric definitions for the resource.
+// Parameters:
+// resourceURI - the identifier of the resource.
+// metricnamespace - metric namespace to query metric definitions for.
+func (client MetricDefinitionsClient) List(ctx context.Context, resourceURI string, metricnamespace string) (result MetricDefinitionCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricDefinitionsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListPreparer(ctx, resourceURI, metricnamespace)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricDefinitionsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricDefinitionsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricDefinitionsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client MetricDefinitionsClient) ListPreparer(ctx context.Context, resourceURI string, metricnamespace string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceUri": resourceURI,
+ }
+
+ const APIVersion = "2018-01-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if len(metricnamespace) > 0 {
+ queryParameters["metricnamespace"] = autorest.Encode("query", metricnamespace)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{resourceUri}/providers/microsoft.insights/metricDefinitions", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricDefinitionsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client MetricDefinitionsClient) ListResponder(resp *http.Response) (result MetricDefinitionCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricnamespaces.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricnamespaces.go
new file mode 100644
index 000000000000..fcb246e56f00
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metricnamespaces.go
@@ -0,0 +1,119 @@
+package insights
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// MetricNamespacesClient is the monitor Management Client
+type MetricNamespacesClient struct {
+ BaseClient
+}
+
+// NewMetricNamespacesClient creates an instance of the MetricNamespacesClient client.
+func NewMetricNamespacesClient(subscriptionID string) MetricNamespacesClient {
+ return NewMetricNamespacesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewMetricNamespacesClientWithBaseURI creates an instance of the MetricNamespacesClient client.
+func NewMetricNamespacesClientWithBaseURI(baseURI string, subscriptionID string) MetricNamespacesClient {
+ return MetricNamespacesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List lists the metric namespaces for the resource.
+// Parameters:
+// resourceURI - the identifier of the resource.
+// startTime - the ISO 8601 conform Date start time from which to query for metric namespaces.
+func (client MetricNamespacesClient) List(ctx context.Context, resourceURI string, startTime string) (result MetricNamespaceCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricNamespacesClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListPreparer(ctx, resourceURI, startTime)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricNamespacesClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricNamespacesClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricNamespacesClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client MetricNamespacesClient) ListPreparer(ctx context.Context, resourceURI string, startTime string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceUri": resourceURI,
+ }
+
+ const APIVersion = "2017-12-01-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if len(startTime) > 0 {
+ queryParameters["startTime"] = autorest.Encode("query", startTime)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{resourceUri}/providers/microsoft.insights/metricNamespaces", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricNamespacesClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client MetricNamespacesClient) ListResponder(resp *http.Response) (result MetricNamespaceCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/metrics.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metrics.go
new file mode 100644
index 000000000000..4c48dcb99e88
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/metrics.go
@@ -0,0 +1,163 @@
+package insights
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// MetricsClient is the monitor Management Client
+type MetricsClient struct {
+ BaseClient
+}
+
+// NewMetricsClient creates an instance of the MetricsClient client.
+func NewMetricsClient(subscriptionID string) MetricsClient {
+ return NewMetricsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewMetricsClientWithBaseURI creates an instance of the MetricsClient client.
+func NewMetricsClientWithBaseURI(baseURI string, subscriptionID string) MetricsClient {
+ return MetricsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List **Lists the metric values for a resource**.
+// Parameters:
+// resourceURI - the identifier of the resource.
+// timespan - the timespan of the query. It is a string with the following format
+// 'startDateTime_ISO/endDateTime_ISO'.
+// interval - the interval (i.e. timegrain) of the query.
+// metricnames - the names of the metrics (comma separated) to retrieve.
+// aggregation - the list of aggregation types (comma separated) to retrieve.
+// top - the maximum number of records to retrieve.
+// Valid only if $filter is specified.
+// Defaults to 10.
+// orderby - the aggregation to use for sorting results and the direction of the sort.
+// Only one order can be specified.
+// Examples: sum asc.
+// filter - the **$filter** is used to reduce the set of metric data returned.
Example:
Metric contains
+// metadata A, B and C.
- Return all time series of C where A = a1 and B = b1 or b2
**$filter=A eq ‘a1’
+// and B eq ‘b1’ or B eq ‘b2’ and C eq ‘*’**
- Invalid variant:
**$filter=A eq ‘a1’ and B eq ‘b1’ and C
+// eq ‘*’ or B = ‘b2’**
This is invalid because the logical or operator cannot separate two different
+// metadata names.
- Return all time series where A = a1, B = b1 and C = c1:
**$filter=A eq ‘a1’ and B eq
+// ‘b1’ and C eq ‘c1’**
- Return all time series where A = a1
**$filter=A eq ‘a1’ and B eq ‘*’ and C eq
+// ‘*’**.
+// resultType - reduces the set of data collected. The syntax allowed depends on the operation. See the
+// operation's description for details.
+// metricnamespace - metric namespace to query metric definitions for.
+func (client MetricsClient) List(ctx context.Context, resourceURI string, timespan string, interval *string, metricnames string, aggregation string, top *int32, orderby string, filter string, resultType ResultType, metricnamespace string) (result Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/MetricsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListPreparer(ctx, resourceURI, timespan, interval, metricnames, aggregation, top, orderby, filter, resultType, metricnamespace)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.MetricsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.MetricsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client MetricsClient) ListPreparer(ctx context.Context, resourceURI string, timespan string, interval *string, metricnames string, aggregation string, top *int32, orderby string, filter string, resultType ResultType, metricnamespace string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceUri": resourceURI,
+ }
+
+ const APIVersion = "2018-01-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if len(timespan) > 0 {
+ queryParameters["timespan"] = autorest.Encode("query", timespan)
+ }
+ if interval != nil {
+ queryParameters["interval"] = autorest.Encode("query", *interval)
+ }
+ if len(metricnames) > 0 {
+ queryParameters["metricnames"] = autorest.Encode("query", metricnames)
+ }
+ if len(aggregation) > 0 {
+ queryParameters["aggregation"] = autorest.Encode("query", aggregation)
+ }
+ if top != nil {
+ queryParameters["top"] = autorest.Encode("query", *top)
+ }
+ if len(orderby) > 0 {
+ queryParameters["orderby"] = autorest.Encode("query", orderby)
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if len(string(resultType)) > 0 {
+ queryParameters["resultType"] = autorest.Encode("query", resultType)
+ }
+ if len(metricnamespace) > 0 {
+ queryParameters["metricnamespace"] = autorest.Encode("query", metricnamespace)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{resourceUri}/providers/microsoft.insights/metrics", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client MetricsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client MetricsClient) ListResponder(resp *http.Response) (result Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/monitor/mgmt/2017-09-01/insights/models.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/models.go
similarity index 57%
rename from services/monitor/mgmt/2017-09-01/insights/models.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/models.go
index 16ff16a90063..681621ecaf86 100644
--- a/services/monitor/mgmt/2017-09-01/insights/models.go
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/models.go
@@ -18,13 +18,18 @@ package insights
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
+ "context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
+// The package's fully qualified name.
+const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2018-11-01-preview/insights"
+
// AggregationType enumerates the values for aggregation type.
type AggregationType string
@@ -43,6 +48,32 @@ const (
Total AggregationType = "Total"
)
+// PossibleAggregationTypeValues returns an array of possible values for the AggregationType const type.
+func PossibleAggregationTypeValues() []AggregationType {
+ return []AggregationType{Average, Count, Maximum, Minimum, None, Total}
+}
+
+// AlertSeverity enumerates the values for alert severity.
+type AlertSeverity string
+
+const (
+ // Four ...
+ Four AlertSeverity = "4"
+ // One ...
+ One AlertSeverity = "1"
+ // Three ...
+ Three AlertSeverity = "3"
+ // Two ...
+ Two AlertSeverity = "2"
+ // Zero ...
+ Zero AlertSeverity = "0"
+)
+
+// PossibleAlertSeverityValues returns an array of possible values for the AlertSeverity const type.
+func PossibleAlertSeverityValues() []AlertSeverity {
+ return []AlertSeverity{Four, One, Three, Two, Zero}
+}
+
// CategoryType enumerates the values for category type.
type CategoryType string
@@ -53,6 +84,11 @@ const (
Metrics CategoryType = "Metrics"
)
+// PossibleCategoryTypeValues returns an array of possible values for the CategoryType const type.
+func PossibleCategoryTypeValues() []CategoryType {
+ return []CategoryType{Logs, Metrics}
+}
+
// ComparisonOperationType enumerates the values for comparison operation type.
type ComparisonOperationType string
@@ -71,6 +107,28 @@ const (
NotEquals ComparisonOperationType = "NotEquals"
)
+// PossibleComparisonOperationTypeValues returns an array of possible values for the ComparisonOperationType const type.
+func PossibleComparisonOperationTypeValues() []ComparisonOperationType {
+ return []ComparisonOperationType{Equals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEquals}
+}
+
+// ConditionalOperator enumerates the values for conditional operator.
+type ConditionalOperator string
+
+const (
+ // ConditionalOperatorEqual ...
+ ConditionalOperatorEqual ConditionalOperator = "Equal"
+ // ConditionalOperatorGreaterThan ...
+ ConditionalOperatorGreaterThan ConditionalOperator = "GreaterThan"
+ // ConditionalOperatorLessThan ...
+ ConditionalOperatorLessThan ConditionalOperator = "LessThan"
+)
+
+// PossibleConditionalOperatorValues returns an array of possible values for the ConditionalOperator const type.
+func PossibleConditionalOperatorValues() []ConditionalOperator {
+ return []ConditionalOperator{ConditionalOperatorEqual, ConditionalOperatorGreaterThan, ConditionalOperatorLessThan}
+}
+
// ConditionOperator enumerates the values for condition operator.
type ConditionOperator string
@@ -85,22 +143,77 @@ const (
ConditionOperatorLessThanOrEqual ConditionOperator = "LessThanOrEqual"
)
+// PossibleConditionOperatorValues returns an array of possible values for the ConditionOperator const type.
+func PossibleConditionOperatorValues() []ConditionOperator {
+ return []ConditionOperator{ConditionOperatorGreaterThan, ConditionOperatorGreaterThanOrEqual, ConditionOperatorLessThan, ConditionOperatorLessThanOrEqual}
+}
+
+// CriterionType enumerates the values for criterion type.
+type CriterionType string
+
+const (
+ // CriterionTypeMultiMetricCriteria ...
+ CriterionTypeMultiMetricCriteria CriterionType = "MultiMetricCriteria"
+ // CriterionTypeStaticThresholdCriterion ...
+ CriterionTypeStaticThresholdCriterion CriterionType = "StaticThresholdCriterion"
+)
+
+// PossibleCriterionTypeValues returns an array of possible values for the CriterionType const type.
+func PossibleCriterionTypeValues() []CriterionType {
+ return []CriterionType{CriterionTypeMultiMetricCriteria, CriterionTypeStaticThresholdCriterion}
+}
+
+// DataStatus enumerates the values for data status.
+type DataStatus string
+
+const (
+ // NotPresent ...
+ NotPresent DataStatus = "notPresent"
+ // Present ...
+ Present DataStatus = "present"
+)
+
+// PossibleDataStatusValues returns an array of possible values for the DataStatus const type.
+func PossibleDataStatusValues() []DataStatus {
+ return []DataStatus{NotPresent, Present}
+}
+
+// Enabled enumerates the values for enabled.
+type Enabled string
+
+const (
+ // False ...
+ False Enabled = "false"
+ // True ...
+ True Enabled = "true"
+)
+
+// PossibleEnabledValues returns an array of possible values for the Enabled const type.
+func PossibleEnabledValues() []Enabled {
+ return []Enabled{False, True}
+}
+
// EventLevel enumerates the values for event level.
type EventLevel string
const (
- // Critical ...
- Critical EventLevel = "Critical"
- // Error ...
- Error EventLevel = "Error"
- // Informational ...
- Informational EventLevel = "Informational"
- // Verbose ...
- Verbose EventLevel = "Verbose"
- // Warning ...
- Warning EventLevel = "Warning"
+ // EventLevelCritical ...
+ EventLevelCritical EventLevel = "Critical"
+ // EventLevelError ...
+ EventLevelError EventLevel = "Error"
+ // EventLevelInformational ...
+ EventLevelInformational EventLevel = "Informational"
+ // EventLevelVerbose ...
+ EventLevelVerbose EventLevel = "Verbose"
+ // EventLevelWarning ...
+ EventLevelWarning EventLevel = "Warning"
)
+// PossibleEventLevelValues returns an array of possible values for the EventLevel const type.
+func PossibleEventLevelValues() []EventLevel {
+ return []EventLevel{EventLevelCritical, EventLevelError, EventLevelInformational, EventLevelVerbose, EventLevelWarning}
+}
+
// MetricStatisticType enumerates the values for metric statistic type.
type MetricStatisticType string
@@ -115,6 +228,26 @@ const (
MetricStatisticTypeSum MetricStatisticType = "Sum"
)
+// PossibleMetricStatisticTypeValues returns an array of possible values for the MetricStatisticType const type.
+func PossibleMetricStatisticTypeValues() []MetricStatisticType {
+ return []MetricStatisticType{MetricStatisticTypeAverage, MetricStatisticTypeMax, MetricStatisticTypeMin, MetricStatisticTypeSum}
+}
+
+// MetricTriggerType enumerates the values for metric trigger type.
+type MetricTriggerType string
+
+const (
+ // MetricTriggerTypeConsecutive ...
+ MetricTriggerTypeConsecutive MetricTriggerType = "Consecutive"
+ // MetricTriggerTypeTotal ...
+ MetricTriggerTypeTotal MetricTriggerType = "Total"
+)
+
+// PossibleMetricTriggerTypeValues returns an array of possible values for the MetricTriggerType const type.
+func PossibleMetricTriggerTypeValues() []MetricTriggerType {
+ return []MetricTriggerType{MetricTriggerTypeConsecutive, MetricTriggerTypeTotal}
+}
+
// OdataType enumerates the values for odata type.
type OdataType string
@@ -127,6 +260,45 @@ const (
OdataTypeRuleDataSource OdataType = "RuleDataSource"
)
+// PossibleOdataTypeValues returns an array of possible values for the OdataType const type.
+func PossibleOdataTypeValues() []OdataType {
+ return []OdataType{OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource, OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource, OdataTypeRuleDataSource}
+}
+
+// OdataTypeBasicAction enumerates the values for odata type basic action.
+type OdataTypeBasicAction string
+
+const (
+ // OdataTypeAction ...
+ OdataTypeAction OdataTypeBasicAction = "Action"
+ // OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction ...
+ OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction OdataTypeBasicAction = "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction"
+ // OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction ...
+ OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction OdataTypeBasicAction = "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"
+)
+
+// PossibleOdataTypeBasicActionValues returns an array of possible values for the OdataTypeBasicAction const type.
+func PossibleOdataTypeBasicActionValues() []OdataTypeBasicAction {
+ return []OdataTypeBasicAction{OdataTypeAction, OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction, OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction}
+}
+
+// OdataTypeBasicMetricAlertCriteria enumerates the values for odata type basic metric alert criteria.
+type OdataTypeBasicMetricAlertCriteria string
+
+const (
+ // OdataTypeMetricAlertCriteria ...
+ OdataTypeMetricAlertCriteria OdataTypeBasicMetricAlertCriteria = "MetricAlertCriteria"
+ // OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria ...
+ OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria OdataTypeBasicMetricAlertCriteria = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria"
+ // OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria ...
+ OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria OdataTypeBasicMetricAlertCriteria = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria"
+)
+
+// PossibleOdataTypeBasicMetricAlertCriteriaValues returns an array of possible values for the OdataTypeBasicMetricAlertCriteria const type.
+func PossibleOdataTypeBasicMetricAlertCriteriaValues() []OdataTypeBasicMetricAlertCriteria {
+ return []OdataTypeBasicMetricAlertCriteria{OdataTypeMetricAlertCriteria, OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria, OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria}
+}
+
// OdataTypeBasicRuleAction enumerates the values for odata type basic rule action.
type OdataTypeBasicRuleAction string
@@ -139,6 +311,11 @@ const (
OdataTypeRuleAction OdataTypeBasicRuleAction = "RuleAction"
)
+// PossibleOdataTypeBasicRuleActionValues returns an array of possible values for the OdataTypeBasicRuleAction const type.
+func PossibleOdataTypeBasicRuleActionValues() []OdataTypeBasicRuleAction {
+ return []OdataTypeBasicRuleAction{OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction, OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction, OdataTypeRuleAction}
+}
+
// OdataTypeBasicRuleCondition enumerates the values for odata type basic rule condition.
type OdataTypeBasicRuleCondition string
@@ -153,18 +330,77 @@ const (
OdataTypeRuleCondition OdataTypeBasicRuleCondition = "RuleCondition"
)
+// PossibleOdataTypeBasicRuleConditionValues returns an array of possible values for the OdataTypeBasicRuleCondition const type.
+func PossibleOdataTypeBasicRuleConditionValues() []OdataTypeBasicRuleCondition {
+ return []OdataTypeBasicRuleCondition{OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition, OdataTypeRuleCondition}
+}
+
+// OnboardingStatus enumerates the values for onboarding status.
+type OnboardingStatus string
+
+const (
+ // NotOnboarded ...
+ NotOnboarded OnboardingStatus = "notOnboarded"
+ // Onboarded ...
+ Onboarded OnboardingStatus = "onboarded"
+ // Unknown ...
+ Unknown OnboardingStatus = "unknown"
+)
+
+// PossibleOnboardingStatusValues returns an array of possible values for the OnboardingStatus const type.
+func PossibleOnboardingStatusValues() []OnboardingStatus {
+ return []OnboardingStatus{NotOnboarded, Onboarded, Unknown}
+}
+
+// ProvisioningState enumerates the values for provisioning state.
+type ProvisioningState string
+
+const (
+ // Canceled ...
+ Canceled ProvisioningState = "Canceled"
+ // Deploying ...
+ Deploying ProvisioningState = "Deploying"
+ // Failed ...
+ Failed ProvisioningState = "Failed"
+ // Succeeded ...
+ Succeeded ProvisioningState = "Succeeded"
+)
+
+// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type.
+func PossibleProvisioningStateValues() []ProvisioningState {
+ return []ProvisioningState{Canceled, Deploying, Failed, Succeeded}
+}
+
+// QueryType enumerates the values for query type.
+type QueryType string
+
+const (
+ // ResultCount ...
+ ResultCount QueryType = "ResultCount"
+)
+
+// PossibleQueryTypeValues returns an array of possible values for the QueryType const type.
+func PossibleQueryTypeValues() []QueryType {
+ return []QueryType{ResultCount}
+}
+
// ReceiverStatus enumerates the values for receiver status.
type ReceiverStatus string
const (
- // Disabled ...
- Disabled ReceiverStatus = "Disabled"
- // Enabled ...
- Enabled ReceiverStatus = "Enabled"
- // NotSpecified ...
- NotSpecified ReceiverStatus = "NotSpecified"
+ // ReceiverStatusDisabled ...
+ ReceiverStatusDisabled ReceiverStatus = "Disabled"
+ // ReceiverStatusEnabled ...
+ ReceiverStatusEnabled ReceiverStatus = "Enabled"
+ // ReceiverStatusNotSpecified ...
+ ReceiverStatusNotSpecified ReceiverStatus = "NotSpecified"
)
+// PossibleReceiverStatusValues returns an array of possible values for the ReceiverStatus const type.
+func PossibleReceiverStatusValues() []ReceiverStatus {
+ return []ReceiverStatus{ReceiverStatusDisabled, ReceiverStatusEnabled, ReceiverStatusNotSpecified}
+}
+
// RecurrenceFrequency enumerates the values for recurrence frequency.
type RecurrenceFrequency string
@@ -187,6 +423,11 @@ const (
RecurrenceFrequencyYear RecurrenceFrequency = "Year"
)
+// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type.
+func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency {
+ return []RecurrenceFrequency{RecurrenceFrequencyDay, RecurrenceFrequencyHour, RecurrenceFrequencyMinute, RecurrenceFrequencyMonth, RecurrenceFrequencyNone, RecurrenceFrequencySecond, RecurrenceFrequencyWeek, RecurrenceFrequencyYear}
+}
+
// ResultType enumerates the values for result type.
type ResultType string
@@ -197,6 +438,11 @@ const (
Metadata ResultType = "Metadata"
)
+// PossibleResultTypeValues returns an array of possible values for the ResultType const type.
+func PossibleResultTypeValues() []ResultType {
+ return []ResultType{Data, Metadata}
+}
+
// ScaleDirection enumerates the values for scale direction.
type ScaleDirection string
@@ -209,6 +455,11 @@ const (
ScaleDirectionNone ScaleDirection = "None"
)
+// PossibleScaleDirectionValues returns an array of possible values for the ScaleDirection const type.
+func PossibleScaleDirectionValues() []ScaleDirection {
+ return []ScaleDirection{ScaleDirectionDecrease, ScaleDirectionIncrease, ScaleDirectionNone}
+}
+
// ScaleType enumerates the values for scale type.
type ScaleType string
@@ -221,6 +472,11 @@ const (
PercentChangeCount ScaleType = "PercentChangeCount"
)
+// PossibleScaleTypeValues returns an array of possible values for the ScaleType const type.
+func PossibleScaleTypeValues() []ScaleType {
+ return []ScaleType{ChangeCount, ExactCount, PercentChangeCount}
+}
+
// Sensitivity enumerates the values for sensitivity.
type Sensitivity string
@@ -233,6 +489,11 @@ const (
Medium Sensitivity = "Medium"
)
+// PossibleSensitivityValues returns an array of possible values for the Sensitivity const type.
+func PossibleSensitivityValues() []Sensitivity {
+ return []Sensitivity{High, Low, Medium}
+}
+
// TimeAggregationOperator enumerates the values for time aggregation operator.
type TimeAggregationOperator string
@@ -249,6 +510,11 @@ const (
TimeAggregationOperatorTotal TimeAggregationOperator = "Total"
)
+// PossibleTimeAggregationOperatorValues returns an array of possible values for the TimeAggregationOperator const type.
+func PossibleTimeAggregationOperatorValues() []TimeAggregationOperator {
+ return []TimeAggregationOperator{TimeAggregationOperatorAverage, TimeAggregationOperatorLast, TimeAggregationOperatorMaximum, TimeAggregationOperatorMinimum, TimeAggregationOperatorTotal}
+}
+
// TimeAggregationType enumerates the values for time aggregation type.
type TimeAggregationType string
@@ -257,6 +523,8 @@ const (
TimeAggregationTypeAverage TimeAggregationType = "Average"
// TimeAggregationTypeCount ...
TimeAggregationTypeCount TimeAggregationType = "Count"
+ // TimeAggregationTypeLast ...
+ TimeAggregationTypeLast TimeAggregationType = "Last"
// TimeAggregationTypeMaximum ...
TimeAggregationTypeMaximum TimeAggregationType = "Maximum"
// TimeAggregationTypeMinimum ...
@@ -265,6 +533,11 @@ const (
TimeAggregationTypeTotal TimeAggregationType = "Total"
)
+// PossibleTimeAggregationTypeValues returns an array of possible values for the TimeAggregationType const type.
+func PossibleTimeAggregationTypeValues() []TimeAggregationType {
+ return []TimeAggregationType{TimeAggregationTypeAverage, TimeAggregationTypeCount, TimeAggregationTypeLast, TimeAggregationTypeMaximum, TimeAggregationTypeMinimum, TimeAggregationTypeTotal}
+}
+
// Unit enumerates the values for unit.
type Unit string
@@ -289,6 +562,95 @@ const (
UnitUnspecified Unit = "Unspecified"
)
+// PossibleUnitValues returns an array of possible values for the Unit const type.
+func PossibleUnitValues() []Unit {
+ return []Unit{UnitBytes, UnitByteSeconds, UnitBytesPerSecond, UnitCount, UnitCountPerSecond, UnitMilliSeconds, UnitPercent, UnitSeconds, UnitUnspecified}
+}
+
+// BasicAction action descriptor.
+type BasicAction interface {
+ AsAlertingAction() (*AlertingAction, bool)
+ AsLogToMetricAction() (*LogToMetricAction, bool)
+ AsAction() (*Action, bool)
+}
+
+// Action action descriptor.
+type Action struct {
+ // OdataType - Possible values include: 'OdataTypeAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction'
+ OdataType OdataTypeBasicAction `json:"odata.type,omitempty"`
+}
+
+func unmarshalBasicAction(body []byte) (BasicAction, error) {
+ var m map[string]interface{}
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return nil, err
+ }
+
+ switch m["odata.type"] {
+ case string(OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction):
+ var aa AlertingAction
+ err := json.Unmarshal(body, &aa)
+ return aa, err
+ case string(OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction):
+ var ltma LogToMetricAction
+ err := json.Unmarshal(body, <ma)
+ return ltma, err
+ default:
+ var a Action
+ err := json.Unmarshal(body, &a)
+ return a, err
+ }
+}
+func unmarshalBasicActionArray(body []byte) ([]BasicAction, error) {
+ var rawMessages []*json.RawMessage
+ err := json.Unmarshal(body, &rawMessages)
+ if err != nil {
+ return nil, err
+ }
+
+ aArray := make([]BasicAction, len(rawMessages))
+
+ for index, rawMessage := range rawMessages {
+ a, err := unmarshalBasicAction(*rawMessage)
+ if err != nil {
+ return nil, err
+ }
+ aArray[index] = a
+ }
+ return aArray, nil
+}
+
+// MarshalJSON is the custom marshaler for Action.
+func (a Action) MarshalJSON() ([]byte, error) {
+ a.OdataType = OdataTypeAction
+ objectMap := make(map[string]interface{})
+ if a.OdataType != "" {
+ objectMap["odata.type"] = a.OdataType
+ }
+ return json.Marshal(objectMap)
+}
+
+// AsAlertingAction is the BasicAction implementation for Action.
+func (a Action) AsAlertingAction() (*AlertingAction, bool) {
+ return nil, false
+}
+
+// AsLogToMetricAction is the BasicAction implementation for Action.
+func (a Action) AsLogToMetricAction() (*LogToMetricAction, bool) {
+ return nil, false
+}
+
+// AsAction is the BasicAction implementation for Action.
+func (a Action) AsAction() (*Action, bool) {
+ return &a, true
+}
+
+// AsBasicAction is the BasicAction implementation for Action.
+func (a Action) AsBasicAction() (BasicAction, bool) {
+ return &a, true
+}
+
// ActionGroup an Azure action group.
type ActionGroup struct {
// GroupShortName - The short name of the action group. This will be used in SMS messages.
@@ -309,6 +671,12 @@ type ActionGroup struct {
AutomationRunbookReceivers *[]AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"`
// VoiceReceivers - The list of voice receivers that are part of this action group.
VoiceReceivers *[]VoiceReceiver `json:"voiceReceivers,omitempty"`
+ // LogicAppReceivers - The list of logic app receivers that are part of this action group.
+ LogicAppReceivers *[]LogicAppReceiver `json:"logicAppReceivers,omitempty"`
+ // AzureFunctionReceivers - The list of azure function receivers that are part of this action group.
+ AzureFunctionReceivers *[]AzureFunctionReceiver `json:"azureFunctionReceivers,omitempty"`
+ // ArmRoleReceivers - The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported.
+ ArmRoleReceivers *[]ArmRoleReceiver `json:"armRoleReceivers,omitempty"`
}
// ActionGroupList a list of action groups.
@@ -529,15 +897,15 @@ type ActivityLogAlertActionList struct {
ActionGroups *[]ActivityLogAlertActionGroup `json:"actionGroups,omitempty"`
}
-// ActivityLogAlertAllOfCondition an Activity Log alert condition that is met when all its member conditions are
-// met.
+// ActivityLogAlertAllOfCondition an Activity Log alert condition that is met when all its member
+// conditions are met.
type ActivityLogAlertAllOfCondition struct {
// AllOf - The list of activity log alert conditions.
AllOf *[]ActivityLogAlertLeafCondition `json:"allOf,omitempty"`
}
-// ActivityLogAlertLeafCondition an Activity Log alert condition that is met by comparing an activity log field and
-// value.
+// ActivityLogAlertLeafCondition an Activity Log alert condition that is met by comparing an activity log
+// field and value.
type ActivityLogAlertLeafCondition struct {
// Field - The name of the field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'.
Field *string `json:"field,omitempty"`
@@ -723,6 +1091,62 @@ func (alar *ActivityLogAlertResource) UnmarshalJSON(body []byte) error {
return nil
}
+// AlertingAction specify action need to be taken when rule type is Alert
+type AlertingAction struct {
+ // Severity - Severity of the alert. Possible values include: 'Zero', 'One', 'Two', 'Three', 'Four'
+ Severity AlertSeverity `json:"severity,omitempty"`
+ // AznsAction - Azure action group reference.
+ AznsAction *AzNsActionGroup `json:"aznsAction,omitempty"`
+ // ThrottlingInMin - time (in minutes) for which Alerts should be throttled or suppressed.
+ ThrottlingInMin *int32 `json:"throttlingInMin,omitempty"`
+ // Trigger - The trigger condition that results in the alert rule being.
+ Trigger *TriggerCondition `json:"trigger,omitempty"`
+ // OdataType - Possible values include: 'OdataTypeAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction'
+ OdataType OdataTypeBasicAction `json:"odata.type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for AlertingAction.
+func (aa AlertingAction) MarshalJSON() ([]byte, error) {
+ aa.OdataType = OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction
+ objectMap := make(map[string]interface{})
+ if aa.Severity != "" {
+ objectMap["severity"] = aa.Severity
+ }
+ if aa.AznsAction != nil {
+ objectMap["aznsAction"] = aa.AznsAction
+ }
+ if aa.ThrottlingInMin != nil {
+ objectMap["throttlingInMin"] = aa.ThrottlingInMin
+ }
+ if aa.Trigger != nil {
+ objectMap["trigger"] = aa.Trigger
+ }
+ if aa.OdataType != "" {
+ objectMap["odata.type"] = aa.OdataType
+ }
+ return json.Marshal(objectMap)
+}
+
+// AsAlertingAction is the BasicAction implementation for AlertingAction.
+func (aa AlertingAction) AsAlertingAction() (*AlertingAction, bool) {
+ return &aa, true
+}
+
+// AsLogToMetricAction is the BasicAction implementation for AlertingAction.
+func (aa AlertingAction) AsLogToMetricAction() (*LogToMetricAction, bool) {
+ return nil, false
+}
+
+// AsAction is the BasicAction implementation for AlertingAction.
+func (aa AlertingAction) AsAction() (*Action, bool) {
+ return nil, false
+}
+
+// AsBasicAction is the BasicAction implementation for AlertingAction.
+func (aa AlertingAction) AsBasicAction() (BasicAction, bool) {
+ return &aa, true
+}
+
// AlertRule an alert rule.
type AlertRule struct {
// Name - the name of the alert rule.
@@ -976,6 +1400,14 @@ func (arrp *AlertRuleResourcePatch) UnmarshalJSON(body []byte) error {
return nil
}
+// ArmRoleReceiver an arm role receiver.
+type ArmRoleReceiver struct {
+ // Name - The name of the arm role receiver. Names must be unique across all receivers within an action group.
+ Name *string `json:"name,omitempty"`
+ // RoleID - The arm role id.
+ RoleID *string `json:"roleId,omitempty"`
+}
+
// AutomationRunbookReceiver the Azure Automation Runbook notification receiver.
type AutomationRunbookReceiver struct {
// AutomationAccountID - The Azure automation account Id which holds this runbook and authenticate to Azure resource.
@@ -1016,7 +1448,8 @@ type AutoscaleProfile struct {
Recurrence *Recurrence `json:"recurrence,omitempty"`
}
-// AutoscaleSetting a setting that contains all of the configuration for the automatic scaling of a resource.
+// AutoscaleSetting a setting that contains all of the configuration for the automatic scaling of a
+// resource.
type AutoscaleSetting struct {
// Profiles - the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified.
Profiles *[]AutoscaleProfile `json:"profiles,omitempty"`
@@ -1149,21 +1582,31 @@ type AutoscaleSettingResourceCollection struct {
NextLink *string `json:"nextLink,omitempty"`
}
-// AutoscaleSettingResourceCollectionIterator provides access to a complete listing of AutoscaleSettingResource
-// values.
+// AutoscaleSettingResourceCollectionIterator provides access to a complete listing of
+// AutoscaleSettingResource values.
type AutoscaleSettingResourceCollectionIterator struct {
i int
page AutoscaleSettingResourceCollectionPage
}
-// Next advances to the next value. If there was an error making
+// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
-func (iter *AutoscaleSettingResourceCollectionIterator) Next() error {
+func (iter *AutoscaleSettingResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
- err := iter.page.Next()
+ err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
@@ -1172,6 +1615,13 @@ func (iter *AutoscaleSettingResourceCollectionIterator) Next() error {
return nil
}
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *AutoscaleSettingResourceCollectionIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter AutoscaleSettingResourceCollectionIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
@@ -1191,6 +1641,11 @@ func (iter AutoscaleSettingResourceCollectionIterator) Value() AutoscaleSettingR
return iter.page.Values()[iter.i]
}
+// Creates a new instance of the AutoscaleSettingResourceCollectionIterator type.
+func NewAutoscaleSettingResourceCollectionIterator(page AutoscaleSettingResourceCollectionPage) AutoscaleSettingResourceCollectionIterator {
+ return AutoscaleSettingResourceCollectionIterator{page: page}
+}
+
// IsEmpty returns true if the ListResult contains no values.
func (asrc AutoscaleSettingResourceCollection) IsEmpty() bool {
return asrc.Value == nil || len(*asrc.Value) == 0
@@ -1198,11 +1653,11 @@ func (asrc AutoscaleSettingResourceCollection) IsEmpty() bool {
// autoscaleSettingResourceCollectionPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
-func (asrc AutoscaleSettingResourceCollection) autoscaleSettingResourceCollectionPreparer() (*http.Request, error) {
+func (asrc AutoscaleSettingResourceCollection) autoscaleSettingResourceCollectionPreparer(ctx context.Context) (*http.Request, error) {
if asrc.NextLink == nil || len(to.String(asrc.NextLink)) < 1 {
return nil, nil
}
- return autorest.Prepare(&http.Request{},
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(asrc.NextLink)))
@@ -1210,14 +1665,24 @@ func (asrc AutoscaleSettingResourceCollection) autoscaleSettingResourceCollectio
// AutoscaleSettingResourceCollectionPage contains a page of AutoscaleSettingResource values.
type AutoscaleSettingResourceCollectionPage struct {
- fn func(AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error)
+ fn func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error)
asrc AutoscaleSettingResourceCollection
}
-// Next advances to the next page of values. If there was an error making
+// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
-func (page *AutoscaleSettingResourceCollectionPage) Next() error {
- next, err := page.fn(page.asrc)
+func (page *AutoscaleSettingResourceCollectionPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ next, err := page.fn(ctx, page.asrc)
if err != nil {
return err
}
@@ -1225,6 +1690,13 @@ func (page *AutoscaleSettingResourceCollectionPage) Next() error {
return nil
}
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *AutoscaleSettingResourceCollectionPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page AutoscaleSettingResourceCollectionPage) NotDone() bool {
return !page.asrc.IsEmpty()
@@ -1243,6 +1715,11 @@ func (page AutoscaleSettingResourceCollectionPage) Values() []AutoscaleSettingRe
return *page.asrc.Value
}
+// Creates a new instance of the AutoscaleSettingResourceCollectionPage type.
+func NewAutoscaleSettingResourceCollectionPage(getNextPage func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error)) AutoscaleSettingResourceCollectionPage {
+ return AutoscaleSettingResourceCollectionPage{fn: getNextPage}
+}
+
// AutoscaleSettingResourcePatch the autoscale setting object for patch operations.
type AutoscaleSettingResourcePatch struct {
// Tags - Resource tags
@@ -1296,6 +1773,16 @@ func (asrp *AutoscaleSettingResourcePatch) UnmarshalJSON(body []byte) error {
return nil
}
+// AzNsActionGroup azure action group
+type AzNsActionGroup struct {
+ // ActionGroup - Azure Action Group reference.
+ ActionGroup *[]string `json:"actionGroup,omitempty"`
+ // EmailSubject - Custom subject override for all email ids in Azure action group
+ EmailSubject *string `json:"emailSubject,omitempty"`
+ // CustomWebhookPayload - Custom payload to be sent for all webhook URI in Azure action group
+ CustomWebhookPayload *string `json:"customWebhookPayload,omitempty"`
+}
+
// AzureAppPushReceiver the Azure mobile App push notification receiver.
type AzureAppPushReceiver struct {
// Name - The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group.
@@ -1304,6 +1791,18 @@ type AzureAppPushReceiver struct {
EmailAddress *string `json:"emailAddress,omitempty"`
}
+// AzureFunctionReceiver an azure function receiver.
+type AzureFunctionReceiver struct {
+ // Name - The name of the azure function receiver. Names must be unique across all receivers within an action group.
+ Name *string `json:"name,omitempty"`
+ // FunctionAppResourceID - The azure resource id of the function app.
+ FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"`
+ // FunctionName - The function name in the function app.
+ FunctionName *string `json:"functionName,omitempty"`
+ // HTTPTriggerURL - The http trigger url where http request sent to.
+ HTTPTriggerURL *string `json:"httpTriggerUrl,omitempty"`
+}
+
// Baseline the baseline values for a single sensitivity value.
type Baseline struct {
// Sensitivity - the sensitivity of the baseline. Possible values include: 'Low', 'Medium', 'High'
@@ -1324,7 +1823,7 @@ type BaselineMetadataValue struct {
// BaselineProperties the baseline properties class.
type BaselineProperties struct {
- // Timespan - The timespan for which the data was retrieved. Its value consists of two datatimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested.
+ // Timespan - The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested.
Timespan *string `json:"timespan,omitempty"`
// Interval - The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made.
Interval *string `json:"interval,omitempty"`
@@ -1351,6 +1850,24 @@ type BaselineResponse struct {
*BaselineProperties `json:"properties,omitempty"`
}
+// MarshalJSON is the custom marshaler for BaselineResponse.
+func (br BaselineResponse) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if br.ID != nil {
+ objectMap["id"] = br.ID
+ }
+ if br.Type != nil {
+ objectMap["type"] = br.Type
+ }
+ if br.Name != nil {
+ objectMap["name"] = br.Name
+ }
+ if br.BaselineProperties != nil {
+ objectMap["properties"] = br.BaselineProperties
+ }
+ return json.Marshal(objectMap)
+}
+
// UnmarshalJSON is the custom unmarshaler for BaselineResponse struct.
func (br *BaselineResponse) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
@@ -1402,7 +1919,7 @@ func (br *BaselineResponse) UnmarshalJSON(body []byte) error {
return nil
}
-// CalculateBaselineResponse the response to a calcualte baseline call.
+// CalculateBaselineResponse the response to a calculate baseline call.
type CalculateBaselineResponse struct {
autorest.Response `json:"-"`
// Type - the resource type of the baseline resource.
@@ -1413,10 +1930,26 @@ type CalculateBaselineResponse struct {
Baseline *[]Baseline `json:"baseline,omitempty"`
}
+// Criteria specifies the criteria for converting log to metric.
+type Criteria struct {
+ // MetricName - Name of the metric
+ MetricName *string `json:"metricName,omitempty"`
+ // Dimensions - List of Dimensions for creating metric
+ Dimensions *[]Dimension `json:"dimensions,omitempty"`
+}
+
+// DataContainer information about a container with data for a given resource.
+type DataContainer struct {
+ // Workspace - Log Analytics workspace information.
+ Workspace *WorkspaceInfo `json:"workspace,omitempty"`
+}
+
// DiagnosticSettings the diagnostic settings.
type DiagnosticSettings struct {
// StorageAccountID - The resource ID of the storage account to which you would like to send Diagnostic Logs.
StorageAccountID *string `json:"storageAccountId,omitempty"`
+ // ServiceBusRuleID - The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility.
+ ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"`
// EventHubAuthorizationRuleID - The resource Id for the event hub authorization rule.
EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"`
// EventHubName - The name of the event hub. If none is specified, the default event hub will be selected.
@@ -1437,7 +1970,8 @@ type DiagnosticSettingsCategory struct {
// DiagnosticSettingsCategoryResource the diagnostic settings category resource.
type DiagnosticSettingsCategoryResource struct {
- autorest.Response `json:"-"`
+ autorest.Response `json:"-"`
+ // DiagnosticSettingsCategory - The properties of a Diagnostic Settings Category.
*DiagnosticSettingsCategory `json:"properties,omitempty"`
// ID - Azure resource Id
ID *string `json:"id,omitempty"`
@@ -1447,6 +1981,24 @@ type DiagnosticSettingsCategoryResource struct {
Type *string `json:"type,omitempty"`
}
+// MarshalJSON is the custom marshaler for DiagnosticSettingsCategoryResource.
+func (dscr DiagnosticSettingsCategoryResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if dscr.DiagnosticSettingsCategory != nil {
+ objectMap["properties"] = dscr.DiagnosticSettingsCategory
+ }
+ if dscr.ID != nil {
+ objectMap["id"] = dscr.ID
+ }
+ if dscr.Name != nil {
+ objectMap["name"] = dscr.Name
+ }
+ if dscr.Type != nil {
+ objectMap["type"] = dscr.Type
+ }
+ return json.Marshal(objectMap)
+}
+
// UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsCategoryResource struct.
func (dscr *DiagnosticSettingsCategoryResource) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
@@ -1498,7 +2050,8 @@ func (dscr *DiagnosticSettingsCategoryResource) UnmarshalJSON(body []byte) error
return nil
}
-// DiagnosticSettingsCategoryResourceCollection represents a collection of diagnostic setting category resources.
+// DiagnosticSettingsCategoryResourceCollection represents a collection of diagnostic setting category
+// resources.
type DiagnosticSettingsCategoryResourceCollection struct {
autorest.Response `json:"-"`
// Value - The collection of diagnostic settings category resources.
@@ -1507,7 +2060,8 @@ type DiagnosticSettingsCategoryResourceCollection struct {
// DiagnosticSettingsResource the diagnostic setting resource.
type DiagnosticSettingsResource struct {
- autorest.Response `json:"-"`
+ autorest.Response `json:"-"`
+ // DiagnosticSettings - Properties of a Diagnostic Settings Resource.
*DiagnosticSettings `json:"properties,omitempty"`
// ID - Azure resource Id
ID *string `json:"id,omitempty"`
@@ -1517,6 +2071,24 @@ type DiagnosticSettingsResource struct {
Type *string `json:"type,omitempty"`
}
+// MarshalJSON is the custom marshaler for DiagnosticSettingsResource.
+func (dsr DiagnosticSettingsResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if dsr.DiagnosticSettings != nil {
+ objectMap["properties"] = dsr.DiagnosticSettings
+ }
+ if dsr.ID != nil {
+ objectMap["id"] = dsr.ID
+ }
+ if dsr.Name != nil {
+ objectMap["name"] = dsr.Name
+ }
+ if dsr.Type != nil {
+ objectMap["type"] = dsr.Type
+ }
+ return json.Marshal(objectMap)
+}
+
// UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsResource struct.
func (dsr *DiagnosticSettingsResource) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
@@ -1575,6 +2147,16 @@ type DiagnosticSettingsResourceCollection struct {
Value *[]DiagnosticSettingsResource `json:"value,omitempty"`
}
+// Dimension specifies the criteria for converting log to metric.
+type Dimension struct {
+ // Name - Name of the dimension
+ Name *string `json:"name,omitempty"`
+ // Operator - Operator for dimension values
+ Operator *string `json:"operator,omitempty"`
+ // Values - List of dimension values
+ Values *[]string `json:"values,omitempty"`
+}
+
// EmailNotification email notification of an autoscale event.
type EmailNotification struct {
// SendToSubscriptionAdministrator - a value indicating whether to send email to subscription administrator.
@@ -1591,7 +2173,7 @@ type EmailReceiver struct {
Name *string `json:"name,omitempty"`
// EmailAddress - The email address of this receiver.
EmailAddress *string `json:"emailAddress,omitempty"`
- // Status - The receiver status of the e-mail. Possible values include: 'NotSpecified', 'Enabled', 'Disabled'
+ // Status - The receiver status of the e-mail. Possible values include: 'ReceiverStatusNotSpecified', 'ReceiverStatusEnabled', 'ReceiverStatusDisabled'
Status ReceiverStatus `json:"status,omitempty"`
}
@@ -1601,6 +2183,14 @@ type EnableRequest struct {
ReceiverName *string `json:"receiverName,omitempty"`
}
+// Error error details.
+type Error struct {
+ // Code - Error code identifying the specific error.
+ Code *string `json:"code,omitempty"`
+ // Message - Error message in the caller's locale.
+ Message *string `json:"message,omitempty"`
+}
+
// ErrorResponse describes the format of Error response.
type ErrorResponse struct {
// Code - Error code
@@ -1619,6 +2209,7 @@ type EventCategoryCollection struct {
// EventData the Azure event log entries are of type EventData
type EventData struct {
+ // Authorization - The sender authorization information.
Authorization *SenderAuthorization `json:"authorization,omitempty"`
// Claims - key value pairs to identify ARM permissions.
Claims map[string]*string `json:"claims"`
@@ -1638,7 +2229,7 @@ type EventData struct {
Category *LocalizableString `json:"category,omitempty"`
// HTTPRequest - the HTTP request info. Usually includes the 'clientRequestId', 'clientIpAddress' (IP address of the user who initiated the event) and 'method' (HTTP method e.g. PUT).
HTTPRequest *HTTPRequestInfo `json:"httpRequest,omitempty"`
- // Level - the event level. Possible values include: 'Critical', 'Error', 'Warning', 'Informational', 'Verbose'
+ // Level - the event level. Possible values include: 'EventLevelCritical', 'EventLevelError', 'EventLevelWarning', 'EventLevelInformational', 'EventLevelVerbose'
Level EventLevel `json:"level,omitempty"`
// ResourceGroupName - the resource group name of the impacted resource.
ResourceGroupName *string `json:"resourceGroupName,omitempty"`
@@ -1701,7 +2292,9 @@ func (ed EventData) MarshalJSON() ([]byte, error) {
if ed.HTTPRequest != nil {
objectMap["httpRequest"] = ed.HTTPRequest
}
- objectMap["level"] = ed.Level
+ if ed.Level != "" {
+ objectMap["level"] = ed.Level
+ }
if ed.ResourceGroupName != nil {
objectMap["resourceGroupName"] = ed.ResourceGroupName
}
@@ -1759,14 +2352,24 @@ type EventDataCollectionIterator struct {
page EventDataCollectionPage
}
-// Next advances to the next value. If there was an error making
+// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
-func (iter *EventDataCollectionIterator) Next() error {
+func (iter *EventDataCollectionIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
- err := iter.page.Next()
+ err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
@@ -1775,6 +2378,13 @@ func (iter *EventDataCollectionIterator) Next() error {
return nil
}
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *EventDataCollectionIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter EventDataCollectionIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
@@ -1794,6 +2404,11 @@ func (iter EventDataCollectionIterator) Value() EventData {
return iter.page.Values()[iter.i]
}
+// Creates a new instance of the EventDataCollectionIterator type.
+func NewEventDataCollectionIterator(page EventDataCollectionPage) EventDataCollectionIterator {
+ return EventDataCollectionIterator{page: page}
+}
+
// IsEmpty returns true if the ListResult contains no values.
func (edc EventDataCollection) IsEmpty() bool {
return edc.Value == nil || len(*edc.Value) == 0
@@ -1801,11 +2416,11 @@ func (edc EventDataCollection) IsEmpty() bool {
// eventDataCollectionPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
-func (edc EventDataCollection) eventDataCollectionPreparer() (*http.Request, error) {
+func (edc EventDataCollection) eventDataCollectionPreparer(ctx context.Context) (*http.Request, error) {
if edc.NextLink == nil || len(to.String(edc.NextLink)) < 1 {
return nil, nil
}
- return autorest.Prepare(&http.Request{},
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(edc.NextLink)))
@@ -1813,14 +2428,24 @@ func (edc EventDataCollection) eventDataCollectionPreparer() (*http.Request, err
// EventDataCollectionPage contains a page of EventData values.
type EventDataCollectionPage struct {
- fn func(EventDataCollection) (EventDataCollection, error)
+ fn func(context.Context, EventDataCollection) (EventDataCollection, error)
edc EventDataCollection
}
-// Next advances to the next page of values. If there was an error making
+// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
-func (page *EventDataCollectionPage) Next() error {
- next, err := page.fn(page.edc)
+func (page *EventDataCollectionPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ next, err := page.fn(ctx, page.edc)
if err != nil {
return err
}
@@ -1828,10 +2453,17 @@ func (page *EventDataCollectionPage) Next() error {
return nil
}
-// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page EventDataCollectionPage) NotDone() bool {
- return !page.edc.IsEmpty()
-}
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *EventDataCollectionPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page EventDataCollectionPage) NotDone() bool {
+ return !page.edc.IsEmpty()
+}
// Response returns the raw server response from the last page request.
func (page EventDataCollectionPage) Response() EventDataCollection {
@@ -1846,6 +2478,11 @@ func (page EventDataCollectionPage) Values() []EventData {
return *page.edc.Value
}
+// Creates a new instance of the EventDataCollectionPage type.
+func NewEventDataCollectionPage(getNextPage func(context.Context, EventDataCollection) (EventDataCollection, error)) EventDataCollectionPage {
+ return EventDataCollectionPage{fn: getNextPage}
+}
+
// HTTPRequestInfo the Http request info.
type HTTPRequestInfo struct {
// ClientRequestID - the client request id.
@@ -1925,7 +2562,9 @@ func (ltrc LocationThresholdRuleCondition) MarshalJSON() ([]byte, error) {
objectMap["failedLocationCount"] = ltrc.FailedLocationCount
}
objectMap["dataSource"] = ltrc.DataSource
- objectMap["odata.type"] = ltrc.OdataType
+ if ltrc.OdataType != "" {
+ objectMap["odata.type"] = ltrc.OdataType
+ }
return json.Marshal(objectMap)
}
@@ -2004,6 +2643,28 @@ func (ltrc *LocationThresholdRuleCondition) UnmarshalJSON(body []byte) error {
return nil
}
+// LogicAppReceiver a logic app receiver.
+type LogicAppReceiver struct {
+ // Name - The name of the logic app receiver. Names must be unique across all receivers within an action group.
+ Name *string `json:"name,omitempty"`
+ // ResourceID - The azure resource id of the logic app receiver.
+ ResourceID *string `json:"resourceId,omitempty"`
+ // CallbackURL - The callback url where http request sent to.
+ CallbackURL *string `json:"callbackUrl,omitempty"`
+}
+
+// LogMetricTrigger a log metrics trigger descriptor.
+type LogMetricTrigger struct {
+ // ThresholdOperator - Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. Possible values include: 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual'
+ ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"`
+ // Threshold - The threshold of the metric trigger.
+ Threshold *float64 `json:"threshold,omitempty"`
+ // MetricTriggerType - Metric Trigger Type - 'Consecutive' or 'Total'. Possible values include: 'MetricTriggerTypeConsecutive', 'MetricTriggerTypeTotal'
+ MetricTriggerType MetricTriggerType `json:"metricTriggerType,omitempty"`
+ // MetricColumn - Evaluation of metric on a particular column
+ MetricColumn *string `json:"metricColumn,omitempty"`
+}
+
// LogProfileCollection represents a collection of log profiles.
type LogProfileCollection struct {
autorest.Response `json:"-"`
@@ -2188,6 +2849,277 @@ func (lprp *LogProfileResourcePatch) UnmarshalJSON(body []byte) error {
return nil
}
+// LogSearchRule log Search Rule Definition
+type LogSearchRule struct {
+ // Description - The description of the Log Search rule.
+ Description *string `json:"description,omitempty"`
+ // Enabled - The flag which indicates whether the Log Search rule is enabled. Value should be true or false. Possible values include: 'True', 'False'
+ Enabled Enabled `json:"enabled,omitempty"`
+ // LastUpdatedTime - Last time the rule was updated in IS08601 format.
+ LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
+ // ProvisioningState - Provisioning state of the scheduled query rule. Possible values include: 'Succeeded', 'Deploying', 'Canceled', 'Failed'
+ ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
+ // Source - Data Source against which rule will Query Data
+ Source *Source `json:"source,omitempty"`
+ // Schedule - Schedule (Frequency, Time Window) for rule. Required for action type - AlertingAction
+ Schedule *Schedule `json:"schedule,omitempty"`
+ // Action - Action needs to be taken on rule execution.
+ Action BasicAction `json:"action,omitempty"`
+}
+
+// UnmarshalJSON is the custom unmarshaler for LogSearchRule struct.
+func (lsr *LogSearchRule) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "description":
+ if v != nil {
+ var description string
+ err = json.Unmarshal(*v, &description)
+ if err != nil {
+ return err
+ }
+ lsr.Description = &description
+ }
+ case "enabled":
+ if v != nil {
+ var enabled Enabled
+ err = json.Unmarshal(*v, &enabled)
+ if err != nil {
+ return err
+ }
+ lsr.Enabled = enabled
+ }
+ case "lastUpdatedTime":
+ if v != nil {
+ var lastUpdatedTime date.Time
+ err = json.Unmarshal(*v, &lastUpdatedTime)
+ if err != nil {
+ return err
+ }
+ lsr.LastUpdatedTime = &lastUpdatedTime
+ }
+ case "provisioningState":
+ if v != nil {
+ var provisioningState ProvisioningState
+ err = json.Unmarshal(*v, &provisioningState)
+ if err != nil {
+ return err
+ }
+ lsr.ProvisioningState = provisioningState
+ }
+ case "source":
+ if v != nil {
+ var source Source
+ err = json.Unmarshal(*v, &source)
+ if err != nil {
+ return err
+ }
+ lsr.Source = &source
+ }
+ case "schedule":
+ if v != nil {
+ var schedule Schedule
+ err = json.Unmarshal(*v, &schedule)
+ if err != nil {
+ return err
+ }
+ lsr.Schedule = &schedule
+ }
+ case "action":
+ if v != nil {
+ action, err := unmarshalBasicAction(*v)
+ if err != nil {
+ return err
+ }
+ lsr.Action = action
+ }
+ }
+ }
+
+ return nil
+}
+
+// LogSearchRulePatch log Search Rule Definition for Patching
+type LogSearchRulePatch struct {
+ // Enabled - The flag which indicates whether the Log Search rule is enabled. Value should be true or false. Possible values include: 'True', 'False'
+ Enabled Enabled `json:"enabled,omitempty"`
+}
+
+// LogSearchRuleResource the Log Search Rule resource.
+type LogSearchRuleResource struct {
+ autorest.Response `json:"-"`
+ // LogSearchRule - The rule properties of the resource.
+ *LogSearchRule `json:"properties,omitempty"`
+ // ID - Azure resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - Azure resource name
+ Name *string `json:"name,omitempty"`
+ // Type - Azure resource type
+ Type *string `json:"type,omitempty"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+}
+
+// MarshalJSON is the custom marshaler for LogSearchRuleResource.
+func (lsrr LogSearchRuleResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if lsrr.LogSearchRule != nil {
+ objectMap["properties"] = lsrr.LogSearchRule
+ }
+ if lsrr.ID != nil {
+ objectMap["id"] = lsrr.ID
+ }
+ if lsrr.Name != nil {
+ objectMap["name"] = lsrr.Name
+ }
+ if lsrr.Type != nil {
+ objectMap["type"] = lsrr.Type
+ }
+ if lsrr.Location != nil {
+ objectMap["location"] = lsrr.Location
+ }
+ if lsrr.Tags != nil {
+ objectMap["tags"] = lsrr.Tags
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for LogSearchRuleResource struct.
+func (lsrr *LogSearchRuleResource) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "properties":
+ if v != nil {
+ var logSearchRule LogSearchRule
+ err = json.Unmarshal(*v, &logSearchRule)
+ if err != nil {
+ return err
+ }
+ lsrr.LogSearchRule = &logSearchRule
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ lsrr.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ lsrr.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ lsrr.Type = &typeVar
+ }
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ lsrr.Location = &location
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ lsrr.Tags = tags
+ }
+ }
+ }
+
+ return nil
+}
+
+// LogSearchRuleResourceCollection represents a collection of Log Search rule resources.
+type LogSearchRuleResourceCollection struct {
+ autorest.Response `json:"-"`
+ // Value - The values for the Log Search Rule resources.
+ Value *[]LogSearchRuleResource `json:"value,omitempty"`
+}
+
+// LogSearchRuleResourcePatch the log search rule resource for patch operations.
+type LogSearchRuleResourcePatch struct {
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // LogSearchRulePatch - The log search rule properties of the resource.
+ *LogSearchRulePatch `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for LogSearchRuleResourcePatch.
+func (lsrrp LogSearchRuleResourcePatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if lsrrp.Tags != nil {
+ objectMap["tags"] = lsrrp.Tags
+ }
+ if lsrrp.LogSearchRulePatch != nil {
+ objectMap["properties"] = lsrrp.LogSearchRulePatch
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for LogSearchRuleResourcePatch struct.
+func (lsrrp *LogSearchRuleResourcePatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ lsrrp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var logSearchRulePatch LogSearchRulePatch
+ err = json.Unmarshal(*v, &logSearchRulePatch)
+ if err != nil {
+ return err
+ }
+ lsrrp.LogSearchRulePatch = &logSearchRulePatch
+ }
+ }
+ }
+
+ return nil
+}
+
// LogSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log.
type LogSettings struct {
// Category - Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.
@@ -2198,6 +3130,47 @@ type LogSettings struct {
RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"`
}
+// LogToMetricAction specify action need to be taken when rule type is converting log to metric
+type LogToMetricAction struct {
+ // Criteria - Severity of the alert
+ Criteria *Criteria `json:"criteria,omitempty"`
+ // OdataType - Possible values include: 'OdataTypeAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction'
+ OdataType OdataTypeBasicAction `json:"odata.type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for LogToMetricAction.
+func (ltma LogToMetricAction) MarshalJSON() ([]byte, error) {
+ ltma.OdataType = OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction
+ objectMap := make(map[string]interface{})
+ if ltma.Criteria != nil {
+ objectMap["criteria"] = ltma.Criteria
+ }
+ if ltma.OdataType != "" {
+ objectMap["odata.type"] = ltma.OdataType
+ }
+ return json.Marshal(objectMap)
+}
+
+// AsAlertingAction is the BasicAction implementation for LogToMetricAction.
+func (ltma LogToMetricAction) AsAlertingAction() (*AlertingAction, bool) {
+ return nil, false
+}
+
+// AsLogToMetricAction is the BasicAction implementation for LogToMetricAction.
+func (ltma LogToMetricAction) AsLogToMetricAction() (*LogToMetricAction, bool) {
+ return <ma, true
+}
+
+// AsAction is the BasicAction implementation for LogToMetricAction.
+func (ltma LogToMetricAction) AsAction() (*Action, bool) {
+ return nil, false
+}
+
+// AsBasicAction is the BasicAction implementation for LogToMetricAction.
+func (ltma LogToMetricAction) AsBasicAction() (BasicAction, bool) {
+ return <ma, true
+}
+
// ManagementEventAggregationCondition how the data that is collected should be combined over time.
type ManagementEventAggregationCondition struct {
// Operator - the condition operator. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual'
@@ -2226,7 +3199,9 @@ func (merc ManagementEventRuleCondition) MarshalJSON() ([]byte, error) {
objectMap["aggregation"] = merc.Aggregation
}
objectMap["dataSource"] = merc.DataSource
- objectMap["odata.type"] = merc.OdataType
+ if merc.OdataType != "" {
+ objectMap["odata.type"] = merc.OdataType
+ }
return json.Marshal(objectMap)
}
@@ -2266,29 +3241,922 @@ func (merc *ManagementEventRuleCondition) UnmarshalJSON(body []byte) error {
switch k {
case "aggregation":
if v != nil {
- var aggregation ManagementEventAggregationCondition
- err = json.Unmarshal(*v, &aggregation)
+ var aggregation ManagementEventAggregationCondition
+ err = json.Unmarshal(*v, &aggregation)
+ if err != nil {
+ return err
+ }
+ merc.Aggregation = &aggregation
+ }
+ case "dataSource":
+ if v != nil {
+ dataSource, err := unmarshalBasicRuleDataSource(*v)
+ if err != nil {
+ return err
+ }
+ merc.DataSource = dataSource
+ }
+ case "odata.type":
+ if v != nil {
+ var odataType OdataTypeBasicRuleCondition
+ err = json.Unmarshal(*v, &odataType)
+ if err != nil {
+ return err
+ }
+ merc.OdataType = odataType
+ }
+ }
+ }
+
+ return nil
+}
+
+// MetadataValue represents a metric metadata value.
+type MetadataValue struct {
+ // Name - the name of the metadata.
+ Name *LocalizableString `json:"name,omitempty"`
+ // Value - the value of the metadata.
+ Value *string `json:"value,omitempty"`
+}
+
+// Metric the result data of a query.
+type Metric struct {
+ // ID - the metric Id.
+ ID *string `json:"id,omitempty"`
+ // Type - the resource type of the metric resource.
+ Type *string `json:"type,omitempty"`
+ // Name - the name and the display name of the metric, i.e. it is localizable string.
+ Name *LocalizableString `json:"name,omitempty"`
+ // Unit - the unit of the metric. Possible values include: 'UnitCount', 'UnitBytes', 'UnitSeconds', 'UnitCountPerSecond', 'UnitBytesPerSecond', 'UnitPercent', 'UnitMilliSeconds', 'UnitByteSeconds', 'UnitUnspecified'
+ Unit Unit `json:"unit,omitempty"`
+ // Timeseries - the time series returned when a data query is performed.
+ Timeseries *[]TimeSeriesElement `json:"timeseries,omitempty"`
+}
+
+// MetricAlertAction an alert action.
+type MetricAlertAction struct {
+ // ActionGroupID - the id of the action group to use.
+ ActionGroupID *string `json:"actionGroupId,omitempty"`
+ // WebhookProperties - The properties of a webhook object.
+ WebhookProperties map[string]*string `json:"webhookProperties"`
+}
+
+// MarshalJSON is the custom marshaler for MetricAlertAction.
+func (maa MetricAlertAction) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if maa.ActionGroupID != nil {
+ objectMap["actionGroupId"] = maa.ActionGroupID
+ }
+ if maa.WebhookProperties != nil {
+ objectMap["webhookProperties"] = maa.WebhookProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// BasicMetricAlertCriteria the rule criteria that defines the conditions of the alert rule.
+type BasicMetricAlertCriteria interface {
+ AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool)
+ AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool)
+ AsMetricAlertCriteria() (*MetricAlertCriteria, bool)
+}
+
+// MetricAlertCriteria the rule criteria that defines the conditions of the alert rule.
+type MetricAlertCriteria struct {
+ // AdditionalProperties - Unmatched properties from the message are deserialized this collection
+ AdditionalProperties map[string]interface{} `json:""`
+ // OdataType - Possible values include: 'OdataTypeMetricAlertCriteria', 'OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria'
+ OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"`
+}
+
+func unmarshalBasicMetricAlertCriteria(body []byte) (BasicMetricAlertCriteria, error) {
+ var m map[string]interface{}
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return nil, err
+ }
+
+ switch m["odata.type"] {
+ case string(OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria):
+ var masrmmc MetricAlertSingleResourceMultipleMetricCriteria
+ err := json.Unmarshal(body, &masrmmc)
+ return masrmmc, err
+ case string(OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria):
+ var mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria
+ err := json.Unmarshal(body, &mamrmmc)
+ return mamrmmc, err
+ default:
+ var mac MetricAlertCriteria
+ err := json.Unmarshal(body, &mac)
+ return mac, err
+ }
+}
+func unmarshalBasicMetricAlertCriteriaArray(body []byte) ([]BasicMetricAlertCriteria, error) {
+ var rawMessages []*json.RawMessage
+ err := json.Unmarshal(body, &rawMessages)
+ if err != nil {
+ return nil, err
+ }
+
+ macArray := make([]BasicMetricAlertCriteria, len(rawMessages))
+
+ for index, rawMessage := range rawMessages {
+ mac, err := unmarshalBasicMetricAlertCriteria(*rawMessage)
+ if err != nil {
+ return nil, err
+ }
+ macArray[index] = mac
+ }
+ return macArray, nil
+}
+
+// MarshalJSON is the custom marshaler for MetricAlertCriteria.
+func (mac MetricAlertCriteria) MarshalJSON() ([]byte, error) {
+ mac.OdataType = OdataTypeMetricAlertCriteria
+ objectMap := make(map[string]interface{})
+ if mac.OdataType != "" {
+ objectMap["odata.type"] = mac.OdataType
+ }
+ for k, v := range mac.AdditionalProperties {
+ objectMap[k] = v
+ }
+ return json.Marshal(objectMap)
+}
+
+// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
+func (mac MetricAlertCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) {
+ return nil, false
+}
+
+// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
+func (mac MetricAlertCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) {
+ return nil, false
+}
+
+// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
+func (mac MetricAlertCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) {
+ return &mac, true
+}
+
+// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria.
+func (mac MetricAlertCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) {
+ return &mac, true
+}
+
+// UnmarshalJSON is the custom unmarshaler for MetricAlertCriteria struct.
+func (mac *MetricAlertCriteria) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ default:
+ if v != nil {
+ var additionalProperties interface{}
+ err = json.Unmarshal(*v, &additionalProperties)
+ if err != nil {
+ return err
+ }
+ if mac.AdditionalProperties == nil {
+ mac.AdditionalProperties = make(map[string]interface{})
+ }
+ mac.AdditionalProperties[k] = additionalProperties
+ }
+ case "odata.type":
+ if v != nil {
+ var odataType OdataTypeBasicMetricAlertCriteria
+ err = json.Unmarshal(*v, &odataType)
+ if err != nil {
+ return err
+ }
+ mac.OdataType = odataType
+ }
+ }
+ }
+
+ return nil
+}
+
+// MetricAlertMultipleResourceMultipleMetricCriteria specifies the metric alert criteria for multiple
+// resource that has multiple metric criteria.
+type MetricAlertMultipleResourceMultipleMetricCriteria struct {
+ // AllOf - the list of multiple metric criteria for this 'all of' operation.
+ AllOf *[]BasicMultiMetricCriteria `json:"allOf,omitempty"`
+ // AdditionalProperties - Unmatched properties from the message are deserialized this collection
+ AdditionalProperties map[string]interface{} `json:""`
+ // OdataType - Possible values include: 'OdataTypeMetricAlertCriteria', 'OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria'
+ OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for MetricAlertMultipleResourceMultipleMetricCriteria.
+func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) {
+ mamrmmc.OdataType = OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria
+ objectMap := make(map[string]interface{})
+ if mamrmmc.AllOf != nil {
+ objectMap["allOf"] = mamrmmc.AllOf
+ }
+ if mamrmmc.OdataType != "" {
+ objectMap["odata.type"] = mamrmmc.OdataType
+ }
+ for k, v := range mamrmmc.AdditionalProperties {
+ objectMap[k] = v
+ }
+ return json.Marshal(objectMap)
+}
+
+// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
+func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) {
+ return nil, false
+}
+
+// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
+func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) {
+ return &mamrmmc, true
+}
+
+// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
+func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) {
+ return nil, false
+}
+
+// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria.
+func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) {
+ return &mamrmmc, true
+}
+
+// UnmarshalJSON is the custom unmarshaler for MetricAlertMultipleResourceMultipleMetricCriteria struct.
+func (mamrmmc *MetricAlertMultipleResourceMultipleMetricCriteria) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "allOf":
+ if v != nil {
+ allOf, err := unmarshalBasicMultiMetricCriteriaArray(*v)
+ if err != nil {
+ return err
+ }
+ mamrmmc.AllOf = &allOf
+ }
+ default:
+ if v != nil {
+ var additionalProperties interface{}
+ err = json.Unmarshal(*v, &additionalProperties)
+ if err != nil {
+ return err
+ }
+ if mamrmmc.AdditionalProperties == nil {
+ mamrmmc.AdditionalProperties = make(map[string]interface{})
+ }
+ mamrmmc.AdditionalProperties[k] = additionalProperties
+ }
+ case "odata.type":
+ if v != nil {
+ var odataType OdataTypeBasicMetricAlertCriteria
+ err = json.Unmarshal(*v, &odataType)
+ if err != nil {
+ return err
+ }
+ mamrmmc.OdataType = odataType
+ }
+ }
+ }
+
+ return nil
+}
+
+// MetricAlertProperties an alert rule.
+type MetricAlertProperties struct {
+ // Description - the description of the metric alert that will be included in the alert email.
+ Description *string `json:"description,omitempty"`
+ // Severity - Alert severity {0, 1, 2, 3, 4}
+ Severity *int32 `json:"severity,omitempty"`
+ // Enabled - the flag that indicates whether the metric alert is enabled.
+ Enabled *bool `json:"enabled,omitempty"`
+ // Scopes - the list of resource id's that this metric alert is scoped to.
+ Scopes *[]string `json:"scopes,omitempty"`
+ // EvaluationFrequency - how often the metric alert is evaluated represented in ISO 8601 duration format.
+ EvaluationFrequency *string `json:"evaluationFrequency,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"`
+ // TargetResourceType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
+ TargetResourceType *string `json:"targetResourceType,omitempty"`
+ // TargetResourceRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
+ 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 *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"`
+ // LastUpdatedTime - Last time the rule was updated in ISO8601 format.
+ LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
+}
+
+// UnmarshalJSON is the custom unmarshaler for MetricAlertProperties struct.
+func (mapVar *MetricAlertProperties) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "description":
+ if v != nil {
+ var description string
+ err = json.Unmarshal(*v, &description)
+ if err != nil {
+ return err
+ }
+ mapVar.Description = &description
+ }
+ case "severity":
+ if v != nil {
+ var severity int32
+ err = json.Unmarshal(*v, &severity)
+ if err != nil {
+ return err
+ }
+ mapVar.Severity = &severity
+ }
+ case "enabled":
+ if v != nil {
+ var enabled bool
+ err = json.Unmarshal(*v, &enabled)
+ if err != nil {
+ return err
+ }
+ mapVar.Enabled = &enabled
+ }
+ case "scopes":
+ if v != nil {
+ var scopes []string
+ err = json.Unmarshal(*v, &scopes)
+ if err != nil {
+ return err
+ }
+ mapVar.Scopes = &scopes
+ }
+ case "evaluationFrequency":
+ if v != nil {
+ var evaluationFrequency string
+ err = json.Unmarshal(*v, &evaluationFrequency)
+ if err != nil {
+ return err
+ }
+ mapVar.EvaluationFrequency = &evaluationFrequency
+ }
+ case "windowSize":
+ if v != nil {
+ var windowSize string
+ err = json.Unmarshal(*v, &windowSize)
+ if err != nil {
+ return err
+ }
+ mapVar.WindowSize = &windowSize
+ }
+ case "targetResourceType":
+ if v != nil {
+ var targetResourceType string
+ err = json.Unmarshal(*v, &targetResourceType)
+ if err != nil {
+ return err
+ }
+ mapVar.TargetResourceType = &targetResourceType
+ }
+ case "targetResourceRegion":
+ if v != nil {
+ var targetResourceRegion string
+ err = json.Unmarshal(*v, &targetResourceRegion)
+ if err != nil {
+ return err
+ }
+ mapVar.TargetResourceRegion = &targetResourceRegion
+ }
+ case "criteria":
+ if v != nil {
+ criteria, err := unmarshalBasicMetricAlertCriteria(*v)
+ if err != nil {
+ return err
+ }
+ mapVar.Criteria = criteria
+ }
+ case "autoMitigate":
+ if v != nil {
+ var autoMitigate bool
+ err = json.Unmarshal(*v, &autoMitigate)
+ if err != nil {
+ return err
+ }
+ mapVar.AutoMitigate = &autoMitigate
+ }
+ case "actions":
+ if v != nil {
+ var actions []MetricAlertAction
+ err = json.Unmarshal(*v, &actions)
+ if err != nil {
+ return err
+ }
+ mapVar.Actions = &actions
+ }
+ case "lastUpdatedTime":
+ if v != nil {
+ var lastUpdatedTime date.Time
+ err = json.Unmarshal(*v, &lastUpdatedTime)
+ if err != nil {
+ return err
+ }
+ mapVar.LastUpdatedTime = &lastUpdatedTime
+ }
+ }
+ }
+
+ return nil
+}
+
+// MetricAlertResource the metric alert resource.
+type MetricAlertResource struct {
+ autorest.Response `json:"-"`
+ // MetricAlertProperties - The alert rule properties of the resource.
+ *MetricAlertProperties `json:"properties,omitempty"`
+ // ID - Azure resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - Azure resource name
+ Name *string `json:"name,omitempty"`
+ // Type - Azure resource type
+ Type *string `json:"type,omitempty"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+}
+
+// MarshalJSON is the custom marshaler for MetricAlertResource.
+func (mar MetricAlertResource) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if mar.MetricAlertProperties != nil {
+ objectMap["properties"] = mar.MetricAlertProperties
+ }
+ if mar.ID != nil {
+ objectMap["id"] = mar.ID
+ }
+ if mar.Name != nil {
+ objectMap["name"] = mar.Name
+ }
+ if mar.Type != nil {
+ objectMap["type"] = mar.Type
+ }
+ if mar.Location != nil {
+ objectMap["location"] = mar.Location
+ }
+ if mar.Tags != nil {
+ objectMap["tags"] = mar.Tags
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for MetricAlertResource struct.
+func (mar *MetricAlertResource) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "properties":
+ if v != nil {
+ var metricAlertProperties MetricAlertProperties
+ err = json.Unmarshal(*v, &metricAlertProperties)
+ if err != nil {
+ return err
+ }
+ mar.MetricAlertProperties = &metricAlertProperties
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ mar.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ mar.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ mar.Type = &typeVar
+ }
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ mar.Location = &location
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ mar.Tags = tags
+ }
+ }
+ }
+
+ return nil
+}
+
+// MetricAlertResourceCollection represents a collection of alert rule resources.
+type MetricAlertResourceCollection struct {
+ autorest.Response `json:"-"`
+ // Value - the values for the alert rule resources.
+ Value *[]MetricAlertResource `json:"value,omitempty"`
+}
+
+// MetricAlertResourcePatch the metric alert resource for patch operations.
+type MetricAlertResourcePatch struct {
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
+ // MetricAlertProperties - The alert rule properties of the resource.
+ *MetricAlertProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for MetricAlertResourcePatch.
+func (marp MetricAlertResourcePatch) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if marp.Tags != nil {
+ objectMap["tags"] = marp.Tags
+ }
+ if marp.MetricAlertProperties != nil {
+ objectMap["properties"] = marp.MetricAlertProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for MetricAlertResourcePatch struct.
+func (marp *MetricAlertResourcePatch) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ marp.Tags = tags
+ }
+ case "properties":
+ if v != nil {
+ var metricAlertProperties MetricAlertProperties
+ err = json.Unmarshal(*v, &metricAlertProperties)
+ if err != nil {
+ return err
+ }
+ marp.MetricAlertProperties = &metricAlertProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// MetricAlertSingleResourceMultipleMetricCriteria specifies the metric alert criteria for a single
+// resource that has multiple metric criteria.
+type MetricAlertSingleResourceMultipleMetricCriteria struct {
+ // AllOf - The list of metric criteria for this 'all of' operation.
+ AllOf *[]MetricCriteria `json:"allOf,omitempty"`
+ // AdditionalProperties - Unmatched properties from the message are deserialized this collection
+ AdditionalProperties map[string]interface{} `json:""`
+ // OdataType - Possible values include: 'OdataTypeMetricAlertCriteria', 'OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria'
+ OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for MetricAlertSingleResourceMultipleMetricCriteria.
+func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) {
+ masrmmc.OdataType = OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria
+ objectMap := make(map[string]interface{})
+ if masrmmc.AllOf != nil {
+ objectMap["allOf"] = masrmmc.AllOf
+ }
+ if masrmmc.OdataType != "" {
+ objectMap["odata.type"] = masrmmc.OdataType
+ }
+ for k, v := range masrmmc.AdditionalProperties {
+ objectMap[k] = v
+ }
+ return json.Marshal(objectMap)
+}
+
+// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
+func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) {
+ return &masrmmc, true
+}
+
+// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
+func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) {
+ return nil, false
+}
+
+// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
+func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) {
+ return nil, false
+}
+
+// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria.
+func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) {
+ return &masrmmc, true
+}
+
+// UnmarshalJSON is the custom unmarshaler for MetricAlertSingleResourceMultipleMetricCriteria struct.
+func (masrmmc *MetricAlertSingleResourceMultipleMetricCriteria) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "allOf":
+ if v != nil {
+ var allOf []MetricCriteria
+ err = json.Unmarshal(*v, &allOf)
+ if err != nil {
+ return err
+ }
+ masrmmc.AllOf = &allOf
+ }
+ default:
+ if v != nil {
+ var additionalProperties interface{}
+ err = json.Unmarshal(*v, &additionalProperties)
+ if err != nil {
+ return err
+ }
+ if masrmmc.AdditionalProperties == nil {
+ masrmmc.AdditionalProperties = make(map[string]interface{})
+ }
+ masrmmc.AdditionalProperties[k] = additionalProperties
+ }
+ case "odata.type":
+ if v != nil {
+ var odataType OdataTypeBasicMetricAlertCriteria
+ err = json.Unmarshal(*v, &odataType)
+ if err != nil {
+ return err
+ }
+ masrmmc.OdataType = odataType
+ }
+ }
+ }
+
+ return nil
+}
+
+// MetricAlertStatus an alert status.
+type MetricAlertStatus struct {
+ // Name - The status name.
+ Name *string `json:"name,omitempty"`
+ // ID - The alert rule arm id.
+ ID *string `json:"id,omitempty"`
+ // Type - The extended resource type name.
+ Type *string `json:"type,omitempty"`
+ // Properties - The alert status properties of the metric alert status.
+ Properties *MetricAlertStatusProperties `json:"properties,omitempty"`
+}
+
+// MetricAlertStatusCollection represents a collection of alert rule resources.
+type MetricAlertStatusCollection struct {
+ autorest.Response `json:"-"`
+ // Value - the values for the alert rule resources.
+ Value *[]MetricAlertStatus `json:"value,omitempty"`
+}
+
+// MetricAlertStatusProperties an alert status properties.
+type MetricAlertStatusProperties struct {
+ // Dimensions - An object describing the type of the dimensions.
+ Dimensions map[string]*string `json:"dimensions"`
+ // Status - status value
+ Status *string `json:"status,omitempty"`
+ // Timestamp - UTC time when the status was checked.
+ Timestamp *date.Time `json:"timestamp,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for MetricAlertStatusProperties.
+func (masp MetricAlertStatusProperties) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if masp.Dimensions != nil {
+ objectMap["dimensions"] = masp.Dimensions
+ }
+ if masp.Status != nil {
+ objectMap["status"] = masp.Status
+ }
+ if masp.Timestamp != nil {
+ objectMap["timestamp"] = masp.Timestamp
+ }
+ return json.Marshal(objectMap)
+}
+
+// MetricAvailability metric availability specifies the time grain (aggregation interval or frequency) and
+// the retention period for that time grain.
+type MetricAvailability struct {
+ // TimeGrain - the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc.
+ TimeGrain *string `json:"timeGrain,omitempty"`
+ // Retention - the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc.
+ Retention *string `json:"retention,omitempty"`
+}
+
+// MetricCriteria criterion to filter metrics.
+type MetricCriteria struct {
+ // Name - Name of the criteria.
+ Name *string `json:"name,omitempty"`
+ // MetricName - Name of the metric.
+ MetricName *string `json:"metricName,omitempty"`
+ // MetricNamespace - Namespace of the metric.
+ MetricNamespace *string `json:"metricNamespace,omitempty"`
+ // Operator - the criteria operator.
+ Operator interface{} `json:"operator,omitempty"`
+ // TimeAggregation - the criteria time aggregation types.
+ TimeAggregation interface{} `json:"timeAggregation,omitempty"`
+ // Threshold - the criteria threshold value that activates the alert.
+ Threshold *float64 `json:"threshold,omitempty"`
+ // Dimensions - List of dimension conditions.
+ Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
+ // AdditionalProperties - Unmatched properties from the message are deserialized this collection
+ AdditionalProperties map[string]interface{} `json:""`
+ // CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion'
+ CriterionType CriterionType `json:"criterionType,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for MetricCriteria.
+func (mc MetricCriteria) MarshalJSON() ([]byte, error) {
+ mc.CriterionType = CriterionTypeStaticThresholdCriterion
+ objectMap := make(map[string]interface{})
+ if mc.Name != nil {
+ objectMap["name"] = mc.Name
+ }
+ if mc.MetricName != nil {
+ objectMap["metricName"] = mc.MetricName
+ }
+ if mc.MetricNamespace != nil {
+ objectMap["metricNamespace"] = mc.MetricNamespace
+ }
+ if mc.Operator != nil {
+ objectMap["operator"] = mc.Operator
+ }
+ if mc.TimeAggregation != nil {
+ objectMap["timeAggregation"] = mc.TimeAggregation
+ }
+ if mc.Threshold != nil {
+ objectMap["threshold"] = mc.Threshold
+ }
+ if mc.Dimensions != nil {
+ objectMap["dimensions"] = mc.Dimensions
+ }
+ if mc.CriterionType != "" {
+ objectMap["criterionType"] = mc.CriterionType
+ }
+ for k, v := range mc.AdditionalProperties {
+ objectMap[k] = v
+ }
+ return json.Marshal(objectMap)
+}
+
+// AsMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria.
+func (mc MetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) {
+ return &mc, true
+}
+
+// AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria.
+func (mc MetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) {
+ return nil, false
+}
+
+// AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria.
+func (mc MetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) {
+ return &mc, true
+}
+
+// UnmarshalJSON is the custom unmarshaler for MetricCriteria struct.
+func (mc *MetricCriteria) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ mc.Name = &name
+ }
+ case "metricName":
+ if v != nil {
+ var metricName string
+ err = json.Unmarshal(*v, &metricName)
+ if err != nil {
+ return err
+ }
+ mc.MetricName = &metricName
+ }
+ case "metricNamespace":
+ if v != nil {
+ var metricNamespace string
+ err = json.Unmarshal(*v, &metricNamespace)
+ if err != nil {
+ return err
+ }
+ mc.MetricNamespace = &metricNamespace
+ }
+ case "operator":
+ if v != nil {
+ var operator interface{}
+ err = json.Unmarshal(*v, &operator)
+ if err != nil {
+ return err
+ }
+ mc.Operator = operator
+ }
+ case "timeAggregation":
+ if v != nil {
+ var timeAggregation interface{}
+ err = json.Unmarshal(*v, &timeAggregation)
+ if err != nil {
+ return err
+ }
+ mc.TimeAggregation = timeAggregation
+ }
+ case "threshold":
+ if v != nil {
+ var threshold float64
+ err = json.Unmarshal(*v, &threshold)
+ if err != nil {
+ return err
+ }
+ mc.Threshold = &threshold
+ }
+ case "dimensions":
+ if v != nil {
+ var dimensions []MetricDimension
+ err = json.Unmarshal(*v, &dimensions)
if err != nil {
return err
}
- merc.Aggregation = &aggregation
+ mc.Dimensions = &dimensions
}
- case "dataSource":
+ default:
if v != nil {
- dataSource, err := unmarshalBasicRuleDataSource(*v)
+ var additionalProperties interface{}
+ err = json.Unmarshal(*v, &additionalProperties)
if err != nil {
return err
}
- merc.DataSource = dataSource
+ if mc.AdditionalProperties == nil {
+ mc.AdditionalProperties = make(map[string]interface{})
+ }
+ mc.AdditionalProperties[k] = additionalProperties
}
- case "odata.type":
+ case "criterionType":
if v != nil {
- var odataType OdataTypeBasicRuleCondition
- err = json.Unmarshal(*v, &odataType)
+ var criterionType CriterionType
+ err = json.Unmarshal(*v, &criterionType)
if err != nil {
return err
}
- merc.OdataType = odataType
+ mc.CriterionType = criterionType
}
}
}
@@ -2296,49 +4164,22 @@ func (merc *ManagementEventRuleCondition) UnmarshalJSON(body []byte) error {
return nil
}
-// MetadataValue represents a metric metadata value.
-type MetadataValue struct {
- // Name - the name of the metadata.
- Name *LocalizableString `json:"name,omitempty"`
- // Value - the value of the metadata.
- Value *string `json:"value,omitempty"`
-}
-
-// Metric the result data of a query.
-type Metric struct {
- // ID - the metric Id.
- ID *string `json:"id,omitempty"`
- // Type - the resource type of the metric resource.
- Type *string `json:"type,omitempty"`
- // Name - the name and the display name of the metric, i.e. it is localizable string.
- Name *LocalizableString `json:"name,omitempty"`
- // Unit - the unit of the metric. Possible values include: 'UnitCount', 'UnitBytes', 'UnitSeconds', 'UnitCountPerSecond', 'UnitBytesPerSecond', 'UnitPercent', 'UnitMilliSeconds', 'UnitByteSeconds', 'UnitUnspecified'
- Unit Unit `json:"unit,omitempty"`
- // Timeseries - the time series returned when a data query is performed.
- Timeseries *[]TimeSeriesElement `json:"timeseries,omitempty"`
-}
-
-// MetricAvailability metric availability specifies the time grain (aggregation interval or frequency) and the
-// retention period for that time grain.
-type MetricAvailability struct {
- // TimeGrain - the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc.
- TimeGrain *string `json:"timeGrain,omitempty"`
- // Retention - the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc.
- Retention *string `json:"retention,omitempty"`
-}
-
// MetricDefinition metric definition class specifies the metadata for a metric.
type MetricDefinition struct {
// IsDimensionRequired - Flag to indicate whether the dimension is required.
IsDimensionRequired *bool `json:"isDimensionRequired,omitempty"`
// ResourceID - the resource identifier of the resource that emitted the metric.
ResourceID *string `json:"resourceId,omitempty"`
+ // Namespace - the namespace the metric belongs to.
+ Namespace *string `json:"namespace,omitempty"`
// Name - the name and the display name of the metric, i.e. it is a localizable string.
Name *LocalizableString `json:"name,omitempty"`
// Unit - the unit of the metric. Possible values include: 'UnitCount', 'UnitBytes', 'UnitSeconds', 'UnitCountPerSecond', 'UnitBytesPerSecond', 'UnitPercent', 'UnitMilliSeconds', 'UnitByteSeconds', 'UnitUnspecified'
Unit Unit `json:"unit,omitempty"`
// PrimaryAggregationType - the primary aggregation type value defining how to use the values for display. Possible values include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total'
PrimaryAggregationType AggregationType `json:"primaryAggregationType,omitempty"`
+ // SupportedAggregationTypes - the collection of what aggregation types are supported.
+ SupportedAggregationTypes *[]AggregationType `json:"supportedAggregationTypes,omitempty"`
// MetricAvailabilities - the collection of what aggregation intervals are available to be queried.
MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"`
// ID - the resource identifier of the metric definition.
@@ -2354,6 +4195,41 @@ type MetricDefinitionCollection struct {
Value *[]MetricDefinition `json:"value,omitempty"`
}
+// MetricDimension specifies a metric dimension.
+type MetricDimension 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"`
+}
+
+// MetricNamespace metric namespace class specifies the metadata for a metric namespace.
+type MetricNamespace struct {
+ // ID - The ID of the metricNamespace.
+ ID *string `json:"id,omitempty"`
+ // Type - The type of the namespace.
+ Type *string `json:"type,omitempty"`
+ // Name - The name of the namespace.
+ Name *string `json:"name,omitempty"`
+ // Properties - Properties which include the fully qualified namespace name.
+ Properties *MetricNamespaceName `json:"properties,omitempty"`
+}
+
+// MetricNamespaceCollection represents collection of metric namespaces.
+type MetricNamespaceCollection struct {
+ autorest.Response `json:"-"`
+ // Value - The values for the metric namespaces.
+ Value *[]MetricNamespace `json:"value,omitempty"`
+}
+
+// MetricNamespaceName the fully qualified metric namespace name.
+type MetricNamespaceName struct {
+ // MetricNamespaceName - The metric namespace name.
+ MetricNamespaceName *string `json:"metricNamespaceName,omitempty"`
+}
+
// MetricSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric.
type MetricSettings struct {
// TimeGrain - the timegrain of the metric in ISO8601 format.
@@ -2378,7 +4254,7 @@ type MetricTrigger struct {
Statistic MetricStatisticType `json:"statistic,omitempty"`
// TimeWindow - the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes.
TimeWindow *string `json:"timeWindow,omitempty"`
- // TimeAggregation - time aggregation type. How the data that is collected should be combined over time. The default value is Average. Possible values include: 'TimeAggregationTypeAverage', 'TimeAggregationTypeMinimum', 'TimeAggregationTypeMaximum', 'TimeAggregationTypeTotal', 'TimeAggregationTypeCount'
+ // TimeAggregation - time aggregation type. How the data that is collected should be combined over time. The default value is Average. Possible values include: 'TimeAggregationTypeAverage', 'TimeAggregationTypeMinimum', 'TimeAggregationTypeMaximum', 'TimeAggregationTypeTotal', 'TimeAggregationTypeCount', 'TimeAggregationTypeLast'
TimeAggregation TimeAggregationType `json:"timeAggregation,omitempty"`
// Operator - the operator that is used to compare the metric data and the threshold. Possible values include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'
Operator ComparisonOperationType `json:"operator,omitempty"`
@@ -2402,6 +4278,121 @@ type MetricValue struct {
Count *int64 `json:"count,omitempty"`
}
+// BasicMultiMetricCriteria the types of conditions for a multi resource alert
+type BasicMultiMetricCriteria interface {
+ AsMetricCriteria() (*MetricCriteria, bool)
+ AsMultiMetricCriteria() (*MultiMetricCriteria, bool)
+}
+
+// MultiMetricCriteria the types of conditions for a multi resource alert
+type MultiMetricCriteria struct {
+ // AdditionalProperties - Unmatched properties from the message are deserialized this collection
+ AdditionalProperties map[string]interface{} `json:""`
+ // CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion'
+ CriterionType CriterionType `json:"criterionType,omitempty"`
+}
+
+func unmarshalBasicMultiMetricCriteria(body []byte) (BasicMultiMetricCriteria, error) {
+ var m map[string]interface{}
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return nil, err
+ }
+
+ switch m["criterionType"] {
+ case string(CriterionTypeStaticThresholdCriterion):
+ var mc MetricCriteria
+ err := json.Unmarshal(body, &mc)
+ return mc, err
+ default:
+ var mmc MultiMetricCriteria
+ err := json.Unmarshal(body, &mmc)
+ return mmc, err
+ }
+}
+func unmarshalBasicMultiMetricCriteriaArray(body []byte) ([]BasicMultiMetricCriteria, error) {
+ var rawMessages []*json.RawMessage
+ err := json.Unmarshal(body, &rawMessages)
+ if err != nil {
+ return nil, err
+ }
+
+ mmcArray := make([]BasicMultiMetricCriteria, len(rawMessages))
+
+ for index, rawMessage := range rawMessages {
+ mmc, err := unmarshalBasicMultiMetricCriteria(*rawMessage)
+ if err != nil {
+ return nil, err
+ }
+ mmcArray[index] = mmc
+ }
+ return mmcArray, nil
+}
+
+// MarshalJSON is the custom marshaler for MultiMetricCriteria.
+func (mmc MultiMetricCriteria) MarshalJSON() ([]byte, error) {
+ mmc.CriterionType = CriterionTypeMultiMetricCriteria
+ objectMap := make(map[string]interface{})
+ if mmc.CriterionType != "" {
+ objectMap["criterionType"] = mmc.CriterionType
+ }
+ for k, v := range mmc.AdditionalProperties {
+ objectMap[k] = v
+ }
+ return json.Marshal(objectMap)
+}
+
+// AsMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria.
+func (mmc MultiMetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) {
+ return nil, false
+}
+
+// AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria.
+func (mmc MultiMetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) {
+ return &mmc, true
+}
+
+// AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria.
+func (mmc MultiMetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) {
+ return &mmc, true
+}
+
+// UnmarshalJSON is the custom unmarshaler for MultiMetricCriteria struct.
+func (mmc *MultiMetricCriteria) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ default:
+ if v != nil {
+ var additionalProperties interface{}
+ err = json.Unmarshal(*v, &additionalProperties)
+ if err != nil {
+ return err
+ }
+ if mmc.AdditionalProperties == nil {
+ mmc.AdditionalProperties = make(map[string]interface{})
+ }
+ mmc.AdditionalProperties[k] = additionalProperties
+ }
+ case "criterionType":
+ if v != nil {
+ var criterionType CriterionType
+ err = json.Unmarshal(*v, &criterionType)
+ if err != nil {
+ return err
+ }
+ mmc.CriterionType = criterionType
+ }
+ }
+ }
+
+ return nil
+}
+
// Operation microsoft Insights API operation definition.
type Operation struct {
// Name - Operation name: {provider}/{resource}/{operation}
@@ -2440,10 +4431,20 @@ type ProxyOnlyResource struct {
Type *string `json:"type,omitempty"`
}
-// Recurrence the repeating times at which this profile begins. This element is not used if the FixedDate element
-// is used.
+// ProxyResource an azure resource object
+type ProxyResource struct {
+ // ID - Azure resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - Azure resource name
+ Name *string `json:"name,omitempty"`
+ // Type - Azure resource type
+ Type *string `json:"type,omitempty"`
+}
+
+// Recurrence the repeating times at which this profile begins. This element is not used if the FixedDate
+// element is used.
type Recurrence struct {
- // Frequency - the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. Possible values include: 'RecurrenceFrequencyNone', 'RecurrenceFrequencySecond', 'RecurrenceFrequencyMinute', 'RecurrenceFrequencyHour', 'RecurrenceFrequencyDay', 'RecurrenceFrequencyWeek', 'RecurrenceFrequencyMonth', 'RecurrenceFrequencyYear'
+ // Frequency - the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly. Possible values include: 'RecurrenceFrequencyNone', 'RecurrenceFrequencySecond', 'RecurrenceFrequencyMinute', 'RecurrenceFrequencyHour', 'RecurrenceFrequencyDay', 'RecurrenceFrequencyWeek', 'RecurrenceFrequencyMonth', 'RecurrenceFrequencyYear'
Frequency RecurrenceFrequency `json:"frequency,omitempty"`
// Schedule - the scheduling constraints for when the profile begins.
Schedule *RecurrentSchedule `json:"schedule,omitempty"`
@@ -2451,7 +4452,7 @@ type Recurrence struct {
// RecurrentSchedule the scheduling constraints for when the profile begins.
type RecurrentSchedule struct {
- // TimeZone - the timezone for the hours of the profile. Some examples of valid timezones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time
+ // TimeZone - the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time
TimeZone *string `json:"timeZone,omitempty"`
// Days - the collection of days that the profile takes effect on. Possible values are Sunday through Saturday.
Days *[]string `json:"days,omitempty"`
@@ -2501,14 +4502,24 @@ type Response struct {
autorest.Response `json:"-"`
// Cost - The integer value representing the cost of the query, for data case.
Cost *float64 `json:"cost,omitempty"`
- // Timespan - The timespan for which the data was retrieved. Its value consists of two datatimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested.
+ // Timespan - The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested.
Timespan *string `json:"timespan,omitempty"`
// Interval - The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made.
Interval *string `json:"interval,omitempty"`
+ // Namespace - The namespace of the metrics been queried
+ Namespace *string `json:"namespace,omitempty"`
+ // Resourceregion - The region of the resource been queried for metrics.
+ Resourceregion *string `json:"resourceregion,omitempty"`
// Value - the value of the collection.
Value *[]Metric `json:"value,omitempty"`
}
+// ResponseWithError an error response from the API.
+type ResponseWithError struct {
+ // Error - Error information.
+ Error *Error `json:"error,omitempty"`
+}
+
// RetentionPolicy specifies the retention policy for the log.
type RetentionPolicy struct {
// Enabled - a value indicating whether the retention policy is enabled.
@@ -2577,7 +4588,9 @@ func unmarshalBasicRuleActionArray(body []byte) ([]BasicRuleAction, error) {
func (ra RuleAction) MarshalJSON() ([]byte, error) {
ra.OdataType = OdataTypeRuleAction
objectMap := make(map[string]interface{})
- objectMap["odata.type"] = ra.OdataType
+ if ra.OdataType != "" {
+ objectMap["odata.type"] = ra.OdataType
+ }
return json.Marshal(objectMap)
}
@@ -2667,7 +4680,9 @@ func (rc RuleCondition) MarshalJSON() ([]byte, error) {
rc.OdataType = OdataTypeRuleCondition
objectMap := make(map[string]interface{})
objectMap["dataSource"] = rc.DataSource
- objectMap["odata.type"] = rc.OdataType
+ if rc.OdataType != "" {
+ objectMap["odata.type"] = rc.OdataType
+ }
return json.Marshal(objectMap)
}
@@ -2791,7 +4806,9 @@ func (rds RuleDataSource) MarshalJSON() ([]byte, error) {
if rds.ResourceURI != nil {
objectMap["resourceUri"] = rds.ResourceURI
}
- objectMap["odata.type"] = rds.OdataType
+ if rds.OdataType != "" {
+ objectMap["odata.type"] = rds.OdataType
+ }
return json.Marshal(objectMap)
}
@@ -2815,8 +4832,8 @@ func (rds RuleDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) {
return &rds, true
}
-// RuleEmailAction specifies the action to send email when the rule condition is evaluated. The discriminator is
-// always RuleEmailAction in this case.
+// RuleEmailAction specifies the action to send email when the rule condition is evaluated. The
+// discriminator is always RuleEmailAction in this case.
type RuleEmailAction struct {
// SendToServiceOwners - Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated.
SendToServiceOwners *bool `json:"sendToServiceOwners,omitempty"`
@@ -2836,7 +4853,9 @@ func (rea RuleEmailAction) MarshalJSON() ([]byte, error) {
if rea.CustomEmails != nil {
objectMap["customEmails"] = rea.CustomEmails
}
- objectMap["odata.type"] = rea.OdataType
+ if rea.OdataType != "" {
+ objectMap["odata.type"] = rea.OdataType
+ }
return json.Marshal(objectMap)
}
@@ -2927,7 +4946,9 @@ func (rmeds RuleManagementEventDataSource) MarshalJSON() ([]byte, error) {
if rmeds.ResourceURI != nil {
objectMap["resourceUri"] = rmeds.ResourceURI
}
- objectMap["odata.type"] = rmeds.OdataType
+ if rmeds.OdataType != "" {
+ objectMap["odata.type"] = rmeds.OdataType
+ }
return json.Marshal(objectMap)
}
@@ -2951,8 +4972,8 @@ func (rmeds RuleManagementEventDataSource) AsBasicRuleDataSource() (BasicRuleDat
return &rmeds, true
}
-// RuleMetricDataSource a rule metric data source. The discriminator value is always RuleMetricDataSource in this
-// case.
+// RuleMetricDataSource a rule metric data source. The discriminator value is always RuleMetricDataSource
+// in this case.
type RuleMetricDataSource struct {
// MetricName - the name of the metric that defines what the rule monitors.
MetricName *string `json:"metricName,omitempty"`
@@ -2972,7 +4993,9 @@ func (rmds RuleMetricDataSource) MarshalJSON() ([]byte, error) {
if rmds.ResourceURI != nil {
objectMap["resourceUri"] = rmds.ResourceURI
}
- objectMap["odata.type"] = rmds.OdataType
+ if rmds.OdataType != "" {
+ objectMap["odata.type"] = rmds.OdataType
+ }
return json.Marshal(objectMap)
}
@@ -3017,7 +5040,9 @@ func (rwa RuleWebhookAction) MarshalJSON() ([]byte, error) {
if rwa.Properties != nil {
objectMap["properties"] = rwa.Properties
}
- objectMap["odata.type"] = rwa.OdataType
+ if rwa.OdataType != "" {
+ objectMap["odata.type"] = rwa.OdataType
+ }
return json.Marshal(objectMap)
}
@@ -3071,8 +5096,17 @@ type ScaleRule struct {
ScaleAction *ScaleAction `json:"scaleAction,omitempty"`
}
-// SenderAuthorization the authorization used by the user who has performed the operation that led to this event.
-// This captures the RBAC properties of the event. These usually include the 'action', 'role' and the 'scope'
+// Schedule defines how often to run the search and the time interval.
+type Schedule struct {
+ // FrequencyInMinutes - frequency (in minutes) at which rule condition should be evaluated.
+ FrequencyInMinutes *int32 `json:"frequencyInMinutes,omitempty"`
+ // TimeWindowInMinutes - Time window for which data needs to be fetched for query (should be greater than or equal to frequencyInMinutes).
+ TimeWindowInMinutes *int32 `json:"timeWindowInMinutes,omitempty"`
+}
+
+// SenderAuthorization the authorization used by the user who has performed the operation that led to this
+// event. This captures the RBAC properties of the event. These usually include the 'action', 'role' and
+// the 'scope'
type SenderAuthorization struct {
// Action - the permissible actions. For instance: microsoft.support/supporttickets/write
Action *string `json:"action,omitempty"`
@@ -3090,10 +5124,22 @@ type SmsReceiver struct {
CountryCode *string `json:"countryCode,omitempty"`
// PhoneNumber - The phone number of the SMS receiver.
PhoneNumber *string `json:"phoneNumber,omitempty"`
- // Status - The status of the receiver. Possible values include: 'NotSpecified', 'Enabled', 'Disabled'
+ // Status - The status of the receiver. Possible values include: 'ReceiverStatusNotSpecified', 'ReceiverStatusEnabled', 'ReceiverStatusDisabled'
Status ReceiverStatus `json:"status,omitempty"`
}
+// Source specifies the log search query.
+type Source struct {
+ // Query - Log search query. Required for action type - AlertingAction
+ Query *string `json:"query,omitempty"`
+ // AuthorizedResources - List of Resource referred into query
+ AuthorizedResources *[]string `json:"authorizedResources,omitempty"`
+ // DataSourceID - The resource uri over which log search query is to be run.
+ DataSourceID *string `json:"dataSourceId,omitempty"`
+ // QueryType - Set value to 'ResultCount'. Possible values include: 'ResultCount'
+ QueryType QueryType `json:"queryType,omitempty"`
+}
+
// ThresholdRuleCondition a rule condition based on a metric crossing a threshold.
type ThresholdRuleCondition struct {
// Operator - the operator used to compare the data and the threshold. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual'
@@ -3114,16 +5160,22 @@ type ThresholdRuleCondition struct {
func (trc ThresholdRuleCondition) MarshalJSON() ([]byte, error) {
trc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition
objectMap := make(map[string]interface{})
- objectMap["operator"] = trc.Operator
+ if trc.Operator != "" {
+ objectMap["operator"] = trc.Operator
+ }
if trc.Threshold != nil {
objectMap["threshold"] = trc.Threshold
}
if trc.WindowSize != nil {
objectMap["windowSize"] = trc.WindowSize
}
- objectMap["timeAggregation"] = trc.TimeAggregation
+ if trc.TimeAggregation != "" {
+ objectMap["timeAggregation"] = trc.TimeAggregation
+ }
objectMap["dataSource"] = trc.DataSource
- objectMap["odata.type"] = trc.OdataType
+ if trc.OdataType != "" {
+ objectMap["odata.type"] = trc.OdataType
+ }
return json.Marshal(objectMap)
}
@@ -3240,7 +5292,7 @@ type TimeSeriesInformation struct {
// TimeWindow a specific date-time for the profile.
type TimeWindow struct {
- // TimeZone - the timezone of the start and end times for the profile. Some examples of valid timezones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time
+ // TimeZone - the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time
TimeZone *string `json:"timeZone,omitempty"`
// Start - the start time for the profile in ISO 8601 format.
Start *date.Time `json:"start,omitempty"`
@@ -3248,7 +5300,111 @@ type TimeWindow struct {
End *date.Time `json:"end,omitempty"`
}
-// VoiceReceiver an voice receiver.
+// TriggerCondition the condition that results in the Log Search rule.
+type TriggerCondition struct {
+ // ThresholdOperator - Evaluation operation for rule - 'GreaterThan' or 'LessThan. Possible values include: 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual'
+ ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"`
+ // Threshold - Result or count threshold based on which rule should be triggered.
+ Threshold *float64 `json:"threshold,omitempty"`
+ // MetricTrigger - Trigger condition for metric query rule
+ MetricTrigger *LogMetricTrigger `json:"metricTrigger,omitempty"`
+}
+
+// VMInsightsOnboardingStatus VM Insights onboarding status for a resource.
+type VMInsightsOnboardingStatus struct {
+ autorest.Response `json:"-"`
+ // VMInsightsOnboardingStatusProperties - Resource properties.
+ *VMInsightsOnboardingStatusProperties `json:"properties,omitempty"`
+ // ID - Azure resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - Azure resource name
+ Name *string `json:"name,omitempty"`
+ // Type - Azure resource type
+ Type *string `json:"type,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for VMInsightsOnboardingStatus.
+func (vios VMInsightsOnboardingStatus) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if vios.VMInsightsOnboardingStatusProperties != nil {
+ objectMap["properties"] = vios.VMInsightsOnboardingStatusProperties
+ }
+ if vios.ID != nil {
+ objectMap["id"] = vios.ID
+ }
+ if vios.Name != nil {
+ objectMap["name"] = vios.Name
+ }
+ if vios.Type != nil {
+ objectMap["type"] = vios.Type
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for VMInsightsOnboardingStatus struct.
+func (vios *VMInsightsOnboardingStatus) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "properties":
+ if v != nil {
+ var VMInsightsOnboardingStatusProperties VMInsightsOnboardingStatusProperties
+ err = json.Unmarshal(*v, &VMInsightsOnboardingStatusProperties)
+ if err != nil {
+ return err
+ }
+ vios.VMInsightsOnboardingStatusProperties = &VMInsightsOnboardingStatusProperties
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ vios.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ vios.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ vios.Type = &typeVar
+ }
+ }
+ }
+
+ return nil
+}
+
+// VMInsightsOnboardingStatusProperties resource properties.
+type VMInsightsOnboardingStatusProperties struct {
+ // ResourceID - Azure Resource Manager identifier of the resource whose onboarding status is being represented.
+ ResourceID *string `json:"resourceId,omitempty"`
+ // OnboardingStatus - The onboarding status for the resource. Note that, a higher level scope, e.g., resource group or subscription, is considered onboarded if at least one resource under it is onboarded. Possible values include: 'Onboarded', 'NotOnboarded', 'Unknown'
+ OnboardingStatus OnboardingStatus `json:"onboardingStatus,omitempty"`
+ // DataStatus - The status of VM Insights data from the resource. When reported as `present` the data array will contain information about the data containers to which data for the specified resource is being routed. Possible values include: 'Present', 'NotPresent'
+ DataStatus DataStatus `json:"dataStatus,omitempty"`
+ // Data - Containers that currently store VM Insights data for the specified resource.
+ Data *[]DataContainer `json:"data,omitempty"`
+}
+
+// VoiceReceiver a voice receiver.
type VoiceReceiver struct {
// Name - The name of the voice receiver. Names must be unique across all receivers within an action group.
Name *string `json:"name,omitempty"`
@@ -3285,3 +5441,76 @@ type WebhookReceiver struct {
// ServiceURI - The URI where webhooks should be sent.
ServiceURI *string `json:"serviceUri,omitempty"`
}
+
+// WorkspaceInfo information about a Log Analytics Workspace.
+type WorkspaceInfo struct {
+ // ID - Azure Resource Manager identifier of the Log Analytics Workspace.
+ ID *string `json:"id,omitempty"`
+ // Location - Location of the Log Analytics workspace.
+ Location *string `json:"location,omitempty"`
+ // WorkspaceInfoProperties - Resource properties.
+ *WorkspaceInfoProperties `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for WorkspaceInfo.
+func (wi WorkspaceInfo) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if wi.ID != nil {
+ objectMap["id"] = wi.ID
+ }
+ if wi.Location != nil {
+ objectMap["location"] = wi.Location
+ }
+ if wi.WorkspaceInfoProperties != nil {
+ objectMap["properties"] = wi.WorkspaceInfoProperties
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for WorkspaceInfo struct.
+func (wi *WorkspaceInfo) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ wi.ID = &ID
+ }
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ wi.Location = &location
+ }
+ case "properties":
+ if v != nil {
+ var workspaceInfoProperties WorkspaceInfoProperties
+ err = json.Unmarshal(*v, &workspaceInfoProperties)
+ if err != nil {
+ return err
+ }
+ wi.WorkspaceInfoProperties = &workspaceInfoProperties
+ }
+ }
+ }
+
+ return nil
+}
+
+// WorkspaceInfoProperties resource properties.
+type WorkspaceInfoProperties struct {
+ // CustomerID - Log Analytics workspace identifier.
+ CustomerID *string `json:"customerId,omitempty"`
+}
diff --git a/services/monitor/mgmt/2017-09-01/insights/operations.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/operations.go
similarity index 92%
rename from services/monitor/mgmt/2017-09-01/insights/operations.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/operations.go
index bcfbfcf93b3d..2d0faf13570c 100644
--- a/services/monitor/mgmt/2017-09-01/insights/operations.go
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/operations.go
@@ -21,6 +21,7 @@ import (
"context"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
"net/http"
)
@@ -41,6 +42,16 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera
// List lists all of the available operations from Microsoft.Insights provider.
func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
req, err := client.ListPreparer(ctx)
if err != nil {
err = autorest.NewErrorWithError(err, "insights.OperationsClient", "List", nil, "Failure preparing request")
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/scheduledqueryrules.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/scheduledqueryrules.go
new file mode 100644
index 000000000000..67495b64432d
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/scheduledqueryrules.go
@@ -0,0 +1,527 @@
+package insights
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// ScheduledQueryRulesClient is the monitor Management Client
+type ScheduledQueryRulesClient struct {
+ BaseClient
+}
+
+// NewScheduledQueryRulesClient creates an instance of the ScheduledQueryRulesClient client.
+func NewScheduledQueryRulesClient(subscriptionID string) ScheduledQueryRulesClient {
+ return NewScheduledQueryRulesClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewScheduledQueryRulesClientWithBaseURI creates an instance of the ScheduledQueryRulesClient client.
+func NewScheduledQueryRulesClientWithBaseURI(baseURI string, subscriptionID string) ScheduledQueryRulesClient {
+ return ScheduledQueryRulesClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates an log search rule.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+// parameters - the parameters of the rule to create or update.
+func (client ScheduledQueryRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ruleName string, parameters LogSearchRuleResource) (result LogSearchRuleResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ScheduledQueryRulesClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: parameters,
+ Constraints: []validation.Constraint{{Target: "parameters.LogSearchRule", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "parameters.LogSearchRule.Source", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "parameters.LogSearchRule.Source.DataSourceID", Name: validation.Null, Rule: true, Chain: nil}}},
+ {Target: "parameters.LogSearchRule.Schedule", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "parameters.LogSearchRule.Schedule.FrequencyInMinutes", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "parameters.LogSearchRule.Schedule.TimeWindowInMinutes", Name: validation.Null, Rule: true, Chain: nil},
+ }},
+ {Target: "parameters.LogSearchRule.Action", Name: validation.Null, Rule: true, Chain: nil},
+ }}}}}); err != nil {
+ return result, validation.NewError("insights.ScheduledQueryRulesClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ruleName, parameters)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.CreateOrUpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "CreateOrUpdate", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "CreateOrUpdate", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client ScheduledQueryRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ruleName string, parameters LogSearchRuleResource) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "ruleName": autorest.Encode("path", ruleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-04-16"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduledQueryRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client ScheduledQueryRulesClient) CreateOrUpdateResponder(resp *http.Response) (result LogSearchRuleResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes a Log Search rule
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+func (client ScheduledQueryRulesClient) Delete(ctx context.Context, resourceGroupName string, ruleName string) (result autorest.Response, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ScheduledQueryRulesClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response != nil {
+ sc = result.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.DeletePreparer(ctx, resourceGroupName, ruleName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.DeleteSender(req)
+ if err != nil {
+ result.Response = resp
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Delete", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.DeleteResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Delete", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client ScheduledQueryRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, ruleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "ruleName": autorest.Encode("path", ruleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-04-16"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduledQueryRulesClient) DeleteSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client ScheduledQueryRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
+ autorest.ByClosing())
+ result.Response = resp
+ return
+}
+
+// Get gets an Log Search rule
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+func (client ScheduledQueryRulesClient) Get(ctx context.Context, resourceGroupName string, ruleName string) (result LogSearchRuleResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ScheduledQueryRulesClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetPreparer(ctx, resourceGroupName, ruleName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client ScheduledQueryRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, ruleName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "ruleName": autorest.Encode("path", ruleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-04-16"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduledQueryRulesClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client ScheduledQueryRulesClient) GetResponder(resp *http.Response) (result LogSearchRuleResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListByResourceGroup list the Log Search rules within a resource group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// filter - the filter to apply on the operation. For more information please see
+// https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx
+func (client ScheduledQueryRulesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result LogSearchRuleResourceCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ScheduledQueryRulesClient.ListByResourceGroup")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "ListByResourceGroup", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "ListByResourceGroup", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "ListByResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
+func (client ScheduledQueryRulesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-04-16"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduledQueryRulesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
+// closes the http.Response Body.
+func (client ScheduledQueryRulesClient) ListByResourceGroupResponder(resp *http.Response) (result LogSearchRuleResourceCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// ListBySubscription list the Log Search rules within a subscription group.
+// Parameters:
+// filter - the filter to apply on the operation. For more information please see
+// https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx
+func (client ScheduledQueryRulesClient) ListBySubscription(ctx context.Context, filter string) (result LogSearchRuleResourceCollection, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ScheduledQueryRulesClient.ListBySubscription")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.ListBySubscriptionPreparer(ctx, filter)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "ListBySubscription", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListBySubscriptionSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "ListBySubscription", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.ListBySubscriptionResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "ListBySubscription", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListBySubscriptionPreparer prepares the ListBySubscription request.
+func (client ScheduledQueryRulesClient) ListBySubscriptionPreparer(ctx context.Context, filter string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-04-16"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/scheduledQueryRules", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduledQueryRulesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
+// closes the http.Response Body.
+func (client ScheduledQueryRulesClient) ListBySubscriptionResponder(resp *http.Response) (result LogSearchRuleResourceCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update update log search Rule.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// ruleName - the name of the rule.
+// parameters - the parameters of the rule to update.
+func (client ScheduledQueryRulesClient) Update(ctx context.Context, resourceGroupName string, ruleName string, parameters LogSearchRuleResourcePatch) (result LogSearchRuleResource, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ScheduledQueryRulesClient.Update")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.UpdatePreparer(ctx, resourceGroupName, ruleName, parameters)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.UpdateSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Update", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.UpdateResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.ScheduledQueryRulesClient", "Update", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client ScheduledQueryRulesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, ruleName string, parameters LogSearchRuleResourcePatch) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "ruleName": autorest.Encode("path", ruleName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2018-04-16"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/scheduledQueryRules/{ruleName}", pathParameters),
+ autorest.WithJSON(parameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client ScheduledQueryRulesClient) UpdateSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client ScheduledQueryRulesClient) UpdateResponder(resp *http.Response) (result LogSearchRuleResource, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/tenantactivitylogs.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/tenantactivitylogs.go
new file mode 100644
index 000000000000..14e2c2b18dce
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/tenantactivitylogs.go
@@ -0,0 +1,174 @@
+package insights
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// TenantActivityLogsClient is the monitor Management Client
+type TenantActivityLogsClient struct {
+ BaseClient
+}
+
+// NewTenantActivityLogsClient creates an instance of the TenantActivityLogsClient client.
+func NewTenantActivityLogsClient(subscriptionID string) TenantActivityLogsClient {
+ return NewTenantActivityLogsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewTenantActivityLogsClientWithBaseURI creates an instance of the TenantActivityLogsClient client.
+func NewTenantActivityLogsClientWithBaseURI(baseURI string, subscriptionID string) TenantActivityLogsClient {
+ return TenantActivityLogsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// List gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for
+// the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that
+// this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that
+// were generated at the tenant level.
+// Parameters:
+// filter - reduces the set of data collected.
The **$filter** is very restricted and allows only the
+// following patterns.
- List events for a resource group: $filter=eventTimestamp ge '' and
+// eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceGroupName eq
+// ''.
- List events for resource: $filter=eventTimestamp ge '' and
+// eventTimestamp le '' and eventChannels eq 'Admin, Operation' and resourceUri eq
+// ''.
- List events for a subscription: $filter=eventTimestamp ge '' and
+// eventTimestamp le '' and eventChannels eq 'Admin, Operation'.
- List events for a resource
+// provider: $filter=eventTimestamp ge '' and eventTimestamp le '' and eventChannels eq
+// 'Admin, Operation' and resourceProvider eq ''.
- List events for a correlation Id:
+// api-version=2014-04-01&$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le
+// '2014-07-20T04:36:37.6407898Z' and eventChannels eq 'Admin, Operation' and correlationId eq
+// ''.
**NOTE**: No other syntax is allowed.
+// selectParameter - used to fetch events with only the given properties.
The **$select** argument is a
+// comma separated list of property names to be returned. Possible values are: *authorization*, *claims*,
+// *correlationId*, *description*, *eventDataId*, *eventName*, *eventTimestamp*, *httpRequest*, *level*,
+// *operationId*, *operationName*, *properties*, *resourceGroupName*, *resourceProviderName*, *resourceId*,
+// *status*, *submissionTimestamp*, *subStatus*, *subscriptionId*
+func (client TenantActivityLogsClient) List(ctx context.Context, filter string, selectParameter string) (result EventDataCollectionPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/TenantActivityLogsClient.List")
+ defer func() {
+ sc := -1
+ if result.edc.Response.Response != nil {
+ sc = result.edc.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx, filter, selectParameter)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.TenantActivityLogsClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.edc.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.TenantActivityLogsClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.edc, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.TenantActivityLogsClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client TenantActivityLogsClient) ListPreparer(ctx context.Context, filter string, selectParameter string) (*http.Request, error) {
+ const APIVersion = "2015-04-01"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+ if len(filter) > 0 {
+ queryParameters["$filter"] = autorest.Encode("query", filter)
+ }
+ if len(selectParameter) > 0 {
+ queryParameters["$select"] = autorest.Encode("query", selectParameter)
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPath("/providers/microsoft.insights/eventtypes/management/values"),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client TenantActivityLogsClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client TenantActivityLogsClient) ListResponder(resp *http.Response) (result EventDataCollection, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client TenantActivityLogsClient) listNextResults(ctx context.Context, lastResults EventDataCollection) (result EventDataCollection, err error) {
+ req, err := lastResults.eventDataCollectionPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "insights.TenantActivityLogsClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "insights.TenantActivityLogsClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.TenantActivityLogsClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client TenantActivityLogsClient) ListComplete(ctx context.Context, filter string, selectParameter string) (result EventDataCollectionIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/TenantActivityLogsClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx, filter, selectParameter)
+ return
+}
diff --git a/services/monitor/mgmt/2017-09-01/insights/version.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/version.go
similarity index 93%
rename from services/monitor/mgmt/2017-09-01/insights/version.go
rename to services/preview/monitor/mgmt/2018-11-01-preview/insights/version.go
index 8450935af864..9d48f92045d2 100644
--- a/services/monitor/mgmt/2017-09-01/insights/version.go
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/version.go
@@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version"
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
- return "Azure-SDK-For-Go/" + version.Number + " insights/2017-09-01"
+ return "Azure-SDK-For-Go/" + version.Number + " insights/2018-11-01-preview"
}
// Version returns the semantic version (see http://semver.org) of the client.
diff --git a/services/preview/monitor/mgmt/2018-11-01-preview/insights/vminsights.go b/services/preview/monitor/mgmt/2018-11-01-preview/insights/vminsights.go
new file mode 100644
index 000000000000..0b12d36c2002
--- /dev/null
+++ b/services/preview/monitor/mgmt/2018-11-01-preview/insights/vminsights.go
@@ -0,0 +1,116 @@
+package insights
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// VMInsightsClient is the monitor Management Client
+type VMInsightsClient struct {
+ BaseClient
+}
+
+// NewVMInsightsClient creates an instance of the VMInsightsClient client.
+func NewVMInsightsClient(subscriptionID string) VMInsightsClient {
+ return NewVMInsightsClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewVMInsightsClientWithBaseURI creates an instance of the VMInsightsClient client.
+func NewVMInsightsClientWithBaseURI(baseURI string, subscriptionID string) VMInsightsClient {
+ return VMInsightsClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// GetOnboardingStatus retrieves the VM Insights onboarding status for the specified resource or resource scope.
+// Parameters:
+// resourceURI - the fully qualified Azure Resource manager identifier of the resource, or scope, whose status
+// to retrieve.
+func (client VMInsightsClient) GetOnboardingStatus(ctx context.Context, resourceURI string) (result VMInsightsOnboardingStatus, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/VMInsightsClient.GetOnboardingStatus")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetOnboardingStatusPreparer(ctx, resourceURI)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.VMInsightsClient", "GetOnboardingStatus", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetOnboardingStatusSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "insights.VMInsightsClient", "GetOnboardingStatus", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetOnboardingStatusResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "insights.VMInsightsClient", "GetOnboardingStatus", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetOnboardingStatusPreparer prepares the GetOnboardingStatus request.
+func (client VMInsightsClient) GetOnboardingStatusPreparer(ctx context.Context, resourceURI string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceUri": resourceURI,
+ }
+
+ const APIVersion = "2018-11-27-preview"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/{resourceUri}/providers/Microsoft.Insights/vmInsightsOnboardingStatuses/default", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetOnboardingStatusSender sends the GetOnboardingStatus request. The method will close the
+// http.Response Body if it receives an error.
+func (client VMInsightsClient) GetOnboardingStatusSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+}
+
+// GetOnboardingStatusResponder handles the response to the GetOnboardingStatus request. The method always
+// closes the http.Response Body.
+func (client VMInsightsClient) GetOnboardingStatusResponder(resp *http.Response) (result VMInsightsOnboardingStatus, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}