From 7595a98e8a966fa46ac4407ee77d2eb4afc6c2f0 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 21 May 2021 23:31:39 +0000 Subject: [PATCH] CodeGen from PR 13852 in Azure/azure-rest-api-specs Merge 38d15346f3dbf6681d8602d8c3f83fd85ab3109d into 6cd86d6d7b655c6f488f95d60f3d3f6731877b01 --- .../src/Generated/ActionGroupsOperations.cs | 49 + .../Generated/ActivityLogAlertsOperations.cs | 42 + .../src/Generated/ActivityLogsOperations.cs | 7 + .../Generated/AlertRuleIncidentsOperations.cs | 14 + .../src/Generated/AlertRulesOperations.cs | 98 +- .../Generated/AutoscaleSettingsOperations.cs | 42 + .../src/Generated/BaselinesOperations.cs | 2 +- .../DataCollectionRuleAssociations.cs | 1010 ------------- ...ataCollectionRuleAssociationsExtensions.cs | 217 --- .../src/Generated/DataCollectionRules.cs | 1262 ----------------- .../DataCollectionRulesExtensions.cs | 251 ---- .../src/Generated/IAlertRulesOperations.cs | 8 +- .../IDataCollectionRuleAssociations.cs | 146 -- .../src/Generated/IDataCollectionRules.cs | 168 --- .../src/Generated/IMetricAlertsOperations.cs | 2 +- .../Generated/IMetricBaselineOperations.cs | 102 -- .../src/Generated/IMonitorManagementClient.cs | 16 +- .../IScheduledQueryRulesOperations.cs | 12 +- .../src/Generated/LogProfilesOperations.cs | 35 + .../src/Generated/MetricAlertsOperations.cs | 53 +- .../Generated/MetricAlertsStatusOperations.cs | 14 + .../src/Generated/MetricBaselineOperations.cs | 480 ------- .../MetricBaselineOperationsExtensions.cs | 153 -- .../Generated/Models/ActionGroupResource.cs | 8 +- .../Models/ActivityLogAlertResource.cs | 15 +- .../Generated/Models/AggregationTypeEnum.cs | 25 + .../src/Generated/Models/AlertRuleResource.cs | 33 +- .../Models/AlertRuleResourcePatch.cs | 20 +- .../src/Generated/Models/ArmRoleReceiver.cs | 4 +- .../Models/AutomationRunbookReceiver.cs | 8 +- .../Models/AutoscaleSettingResource.cs | 15 +- .../Generated/Models/AzureFunctionReceiver.cs | 4 +- .../Models/AzureMonitorMetricsDestination.cs | 67 - .../src/Generated/Models/AzureResource.cs | 116 ++ .../src/Generated/Models/Baseline.cs | 91 -- .../Generated/Models/BaselineMetadataValue.cs | 72 - .../src/Generated/Models/BaselineResponse.cs | 171 --- .../Models/CalculateBaselineResponse.cs | 100 -- .../Generated/Models/ConditionalOperator.cs | 2 + ...lectionRuleAssociationProxyOnlyResource.cs | 96 -- .../Models/DataCollectionRuleDataSources.cs | 53 - .../Models/DataCollectionRuleDestinations.cs | 47 - .../Models/DataCollectionRuleResource.cs | 139 -- .../src/Generated/Models/DataFlow.cs | 76 - .../src/Generated/Models/DataSourcesSpec.cs | 80 -- .../src/Generated/Models/DestinationsSpec.cs | 59 - .../DestinationsSpecAzureMonitorMetrics.cs | 54 - .../Generated/Models/DynamicMetricCriteria.cs | 7 +- .../src/Generated/Models/EmailReceiver.cs | 4 +- ...{ResourceForUpdate.cs => ErrorContract.cs} | 29 +- .../Models/ErrorContractException.cs | 62 + .../Generated/Models/ExtensionDataSource.cs | 110 -- .../Models/LogAnalyticsDestination.cs | 78 - .../src/Generated/Models/LogMetricTrigger.cs | 8 +- .../Generated/Models/LogProfileResource.cs | 15 +- .../Generated/Models/LogSearchRuleResource.cs | 53 +- .../src/Generated/Models/LogicAppReceiver.cs | 4 +- .../src/Generated/Models/Metric.cs | 25 +- .../src/Generated/Models/MetricAlertAction.cs | 9 +- .../Generated/Models/MetricAlertResource.cs | 54 +- .../Models/MetricAlertResourcePatch.cs | 42 +- .../src/Generated/Models/MetricCriteria.cs | 7 +- .../src/Generated/Models/MetricDefinition.cs | 20 +- .../src/Generated/Models/MetricNamespace.cs | 20 +- .../src/Generated/Models/MetricTrigger.cs | 12 +- .../Generated/Models/MultiMetricCriteria.cs | 12 +- .../Models/NamespaceClassification.cs | 66 + .../Generated/Models/PerfCounterDataSource.cs | 143 -- .../src/Generated/Models/Resource.cs | 36 +- .../src/Generated/Models/Response.cs | 16 +- .../src/Generated/Models/RuleDataSource.cs | 31 +- .../Models/RuleManagementEventDataSource.cs | 10 +- .../Generated/Models/RuleMetricDataSource.cs | 10 +- .../src/Generated/Models/Sensitivity.cs | 66 - .../src/Generated/Models/SyslogDataSource.cs | 107 -- .../Generated/Models/TimeSeriesBaseline.cs | 14 +- .../Generated/Models/TimeSeriesInformation.cs | 91 -- .../src/Generated/Models/TriggerCondition.cs | 9 +- .../src/Generated/Models/WebhookReceiver.cs | 4 +- .../Models/WindowsEventLogDataSource.cs | 117 -- .../src/Generated/MonitorManagementClient.cs | 21 +- .../PrivateEndpointConnectionsOperations.cs | 28 + .../PrivateLinkResourcesOperations.cs | 14 + ...ivateLinkScopeOperationStatusOperations.cs | 7 + .../PrivateLinkScopedResourcesOperations.cs | 28 + .../Generated/PrivateLinkScopesOperations.cs | 42 + .../ScheduledQueryRulesOperations.cs | 78 +- .../src/Generated/SdkInfo_MonitorClient.cs | 18 +- 88 files changed, 1199 insertions(+), 5866 deletions(-) delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociations.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsExtensions.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRules.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesExtensions.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociations.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRules.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricBaselineOperations.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperations.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperationsExtensions.cs create mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AggregationTypeEnum.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorMetricsDestination.cs create mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureResource.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Baseline.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineMetadataValue.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineResponse.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/CalculateBaselineResponse.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResource.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDataSources.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDestinations.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResource.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataFlow.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataSourcesSpec.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpec.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpecAzureMonitorMetrics.cs rename sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/{ResourceForUpdate.cs => ErrorContract.cs} (51%) create mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContractException.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ExtensionDataSource.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogAnalyticsDestination.cs create mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/NamespaceClassification.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/PerfCounterDataSource.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Sensitivity.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/SyslogDataSource.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesInformation.cs delete mode 100644 sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WindowsEventLogDataSource.cs diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperations.cs index e1e63466085b..97e4eaf12a0e 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActionGroupsOperations.cs @@ -105,6 +105,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -319,6 +326,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -505,6 +519,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -672,6 +693,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -866,6 +894,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1044,6 +1079,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-06-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1233,6 +1275,13 @@ internal ActionGroupsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (receiverName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "receiverName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperations.cs index 861e5a5c1e24..3320c9288777 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogAlertsOperations.cs @@ -89,6 +89,13 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -311,6 +318,13 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -497,6 +511,13 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -672,6 +693,13 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -866,6 +894,13 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2017-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1040,6 +1075,13 @@ internal ActivityLogAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogsOperations.cs index 0bb485558e70..e6b628ea59b6 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ActivityLogsOperations.cs @@ -97,6 +97,13 @@ internal ActivityLogsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperations.cs index 4f17f6c37e44..7b2a975fc85a 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRuleIncidentsOperations.cs @@ -101,6 +101,13 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -292,6 +299,13 @@ internal AlertRuleIncidentsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperations.cs index 992f576643d7..5a1f02578cd2 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AlertRulesOperations.cs @@ -105,6 +105,13 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -122,7 +129,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -290,7 +297,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -316,6 +323,13 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -332,7 +346,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -401,14 +415,13 @@ internal AlertRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -418,10 +431,6 @@ internal AlertRulesOperations(MonitorManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -463,7 +472,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -492,6 +501,13 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -508,7 +524,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -577,14 +593,13 @@ internal AlertRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -594,10 +609,6 @@ internal AlertRulesOperations(MonitorManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -682,6 +693,13 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -711,7 +729,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules/{ruleName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName)); @@ -876,7 +894,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -901,6 +919,13 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -916,7 +941,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/alertrules").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); @@ -984,14 +1009,13 @@ internal AlertRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1001,10 +1025,6 @@ internal AlertRulesOperations(MonitorManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1058,7 +1078,7 @@ internal AlertRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1079,6 +1099,13 @@ internal AlertRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1093,7 +1120,7 @@ internal AlertRulesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/alertrules").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/alertrules").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -1160,14 +1187,13 @@ internal AlertRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1177,10 +1203,6 @@ internal AlertRulesOperations(MonitorManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperations.cs index 2d2193992b4b..e613ac64a9cb 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/AutoscaleSettingsOperations.cs @@ -87,6 +87,13 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -285,6 +292,13 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -496,6 +510,13 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -667,6 +688,13 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -852,6 +880,13 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1046,6 +1081,13 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2015-04-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperations.cs index 49715e977715..c3e5a5f0b47a 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/BaselinesOperations.cs @@ -142,7 +142,7 @@ internal BaselinesOperations(MonitorManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/metricBaselines").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/metricBaselines").ToString(); _url = _url.Replace("{resourceUri}", resourceUri); List _queryParameters = new List(); if (metricnames != null) diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociations.cs deleted file mode 100644 index 4fae9f9b9192..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociations.cs +++ /dev/null @@ -1,1010 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor -{ - using Microsoft.Rest; - - using Models; - - using Newtonsoft.Json; - - using System.Collections; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// DataCollectionRuleAssociations operations. - /// - public partial class DataCollectionRuleAssociations : IServiceOperations, IDataCollectionRuleAssociations - { - /// - /// Initializes a new instance of the DataCollectionRuleAssociations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - public DataCollectionRuleAssociations(MonitorManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the MonitorManagementClient - /// - public MonitorManagementClient Client { get; private set; } - - /// - /// Lists associations for the specified resource. - /// - /// - /// The identifier of the resource. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListByResourceWithHttpMessagesAsync(string resourceUri, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceUri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); - } - if (resourceUri != null) - { - if (resourceUri.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); - } - } - string apiVersion = "2019-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceUri", resourceUri); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResource", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations").ToString(); - _url = _url.Replace("{resourceUri}", resourceUri); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach (var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists associations for the specified data collection rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListByRuleWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.SubscriptionId != null) - { - if (Client.SubscriptionId.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (dataCollectionRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionRuleName"); - } - if (dataCollectionRuleName != null) - { - if (dataCollectionRuleName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "dataCollectionRuleName", 64); - } - if (dataCollectionRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "dataCollectionRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataCollectionRuleName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataCollectionRuleName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("dataCollectionRuleName", dataCollectionRuleName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByRule", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}/associations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{dataCollectionRuleName}", System.Uri.EscapeDataString(dataCollectionRuleName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach (var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Returns the specified association. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceUri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); - } - if (resourceUri != null) - { - if (resourceUri.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); - } - } - if (associationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "associationName"); - } - if (associationName != null) - { - if (associationName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "associationName", 64); - } - if (associationName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "associationName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(associationName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "associationName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceUri", resourceUri); - tracingParameters.Add("associationName", associationName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}").ToString(); - _url = _url.Replace("{resourceUri}", resourceUri); - _url = _url.Replace("{associationName}", System.Uri.EscapeDataString(associationName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach (var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates or updates an association. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The payload - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateWithHttpMessagesAsync(string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceUri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); - } - if (resourceUri != null) - { - if (resourceUri.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); - } - } - if (associationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "associationName"); - } - if (associationName != null) - { - if (associationName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "associationName", 64); - } - if (associationName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "associationName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(associationName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "associationName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (body != null) - { - body.Validate(); - } - string apiVersion = "2019-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceUri", resourceUri); - tracingParameters.Add("associationName", associationName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("body", body); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}").ToString(); - _url = _url.Replace("{resourceUri}", resourceUri); - _url = _url.Replace("{associationName}", System.Uri.EscapeDataString(associationName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach (var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if (body != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes an association. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceUri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); - } - if (resourceUri != null) - { - if (resourceUri.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceUri", 1); - } - } - if (associationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "associationName"); - } - if (associationName != null) - { - if (associationName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "associationName", 64); - } - if (associationName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "associationName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(associationName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "associationName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceUri", resourceUri); - tracingParameters.Add("associationName", associationName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/Microsoft.Insights/dataCollectionRuleAssociations/{associationName}").ToString(); - _url = _url.Replace("{resourceUri}", resourceUri); - _url = _url.Replace("{associationName}", System.Uri.EscapeDataString(associationName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach (var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsExtensions.cs deleted file mode 100644 index cb5e017e2e08..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRuleAssociationsExtensions.cs +++ /dev/null @@ -1,217 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor -{ - using Models; - - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for DataCollectionRuleAssociations. - /// - public static partial class DataCollectionRuleAssociationsExtensions - { - /// - /// Lists associations for the specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - public static Page ListByResource(this IDataCollectionRuleAssociations operations, string resourceUri) - { - return operations.ListByResourceAsync(resourceUri).GetAwaiter().GetResult(); - } - - /// - /// Lists associations for the specified resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceAsync(this IDataCollectionRuleAssociations operations, string resourceUri, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceWithHttpMessagesAsync(resourceUri, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists associations for the specified data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - public static Page ListByRule(this IDataCollectionRuleAssociations operations, string resourceGroupName, string dataCollectionRuleName) - { - return operations.ListByRuleAsync(resourceGroupName, dataCollectionRuleName).GetAwaiter().GetResult(); - } - - /// - /// Lists associations for the specified data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByRuleAsync(this IDataCollectionRuleAssociations operations, string resourceGroupName, string dataCollectionRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByRuleWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns the specified association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - public static DataCollectionRuleAssociationProxyOnlyResource Get(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName) - { - return operations.GetAsync(resourceUri, associationName).GetAwaiter().GetResult(); - } - - /// - /// Returns the specified association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, associationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates an association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The payload - /// - public static DataCollectionRuleAssociationProxyOnlyResource Create(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource)) - { - return operations.CreateAsync(resourceUri, associationName, body).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates an association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The payload - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceUri, associationName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes an association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - public static void Delete(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName) - { - operations.DeleteAsync(resourceUri, associationName).GetAwaiter().GetResult(); - } - - /// - /// Deletes an association. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDataCollectionRuleAssociations operations, string resourceUri, string associationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceUri, associationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRules.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRules.cs deleted file mode 100644 index 8b5de5f0a032..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRules.cs +++ /dev/null @@ -1,1262 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor -{ - using Microsoft.Rest; - - using Models; - - using Newtonsoft.Json; - - using System.Collections; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// DataCollectionRules operations. - /// - public partial class DataCollectionRules : IServiceOperations, IDataCollectionRules - { - /// - /// Initializes a new instance of the DataCollectionRules class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - public DataCollectionRules(MonitorManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the MonitorManagementClient - /// - public MonitorManagementClient Client { get; private set; } - - /// - /// Lists all data collection rules in the specified resource group. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.SubscriptionId != null) - { - if (Client.SubscriptionId.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach (var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all data collection rules in the specified subscription. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.SubscriptionId != null) - { - if (Client.SubscriptionId.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - string apiVersion = "2019-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Insights/dataCollectionRules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach (var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Returns the specified data collection rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.SubscriptionId != null) - { - if (Client.SubscriptionId.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (dataCollectionRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionRuleName"); - } - if (dataCollectionRuleName != null) - { - if (dataCollectionRuleName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "dataCollectionRuleName", 64); - } - if (dataCollectionRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "dataCollectionRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataCollectionRuleName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataCollectionRuleName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("dataCollectionRuleName", dataCollectionRuleName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{dataCollectionRuleName}", System.Uri.EscapeDataString(dataCollectionRuleName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach (var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates or updates a data collection rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.SubscriptionId != null) - { - if (Client.SubscriptionId.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (dataCollectionRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionRuleName"); - } - if (dataCollectionRuleName != null) - { - if (dataCollectionRuleName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "dataCollectionRuleName", 64); - } - if (dataCollectionRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "dataCollectionRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataCollectionRuleName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataCollectionRuleName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (body != null) - { - body.Validate(); - } - string apiVersion = "2019-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("dataCollectionRuleName", dataCollectionRuleName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("body", body); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{dataCollectionRuleName}", System.Uri.EscapeDataString(dataCollectionRuleName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach (var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if (body != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Updates part of a data collection rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, ResourceForUpdate body = default(ResourceForUpdate), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.SubscriptionId != null) - { - if (Client.SubscriptionId.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (dataCollectionRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionRuleName"); - } - if (dataCollectionRuleName != null) - { - if (dataCollectionRuleName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "dataCollectionRuleName", 64); - } - if (dataCollectionRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "dataCollectionRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataCollectionRuleName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataCollectionRuleName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("dataCollectionRuleName", dataCollectionRuleName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("body", body); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{dataCollectionRuleName}", System.Uri.EscapeDataString(dataCollectionRuleName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach (var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if (body != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a data collection rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.SubscriptionId != null) - { - if (Client.SubscriptionId.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); - } - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (dataCollectionRuleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dataCollectionRuleName"); - } - if (dataCollectionRuleName != null) - { - if (dataCollectionRuleName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "dataCollectionRuleName", 64); - } - if (dataCollectionRuleName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "dataCollectionRuleName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataCollectionRuleName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataCollectionRuleName", "^[-\\w\\._\\(\\)]+$"); - } - } - string apiVersion = "2019-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("dataCollectionRuleName", dataCollectionRuleName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{dataCollectionRuleName}", System.Uri.EscapeDataString(dataCollectionRuleName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += "?" + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - - - if (customHeaders != null) - { - foreach (var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new HttpOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesExtensions.cs deleted file mode 100644 index 1c443c8cbf1a..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/DataCollectionRulesExtensions.cs +++ /dev/null @@ -1,251 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor -{ - using Models; - - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for DataCollectionRules. - /// - public static partial class DataCollectionRulesExtensions - { - /// - /// Lists all data collection rules in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - public static Page ListByResourceGroup(this IDataCollectionRules operations, string resourceGroupName) - { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Lists all data collection rules in the specified resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IDataCollectionRules operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all data collection rules in the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - public static Page ListBySubscription(this IDataCollectionRules operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } - - /// - /// Lists all data collection rules in the specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IDataCollectionRules operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Returns the specified data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - public static DataCollectionRuleResource Get(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName) - { - return operations.GetAsync(resourceGroupName, dataCollectionRuleName).GetAwaiter().GetResult(); - } - - /// - /// Returns the specified data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - public static DataCollectionRuleResource Create(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource)) - { - return operations.CreateAsync(resourceGroupName, dataCollectionRuleName, body).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates part of a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - public static DataCollectionRuleResource Update(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, ResourceForUpdate body = default(ResourceForUpdate)) - { - return operations.UpdateAsync(resourceGroupName, dataCollectionRuleName, body).GetAwaiter().GetResult(); - } - - /// - /// Updates part of a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, ResourceForUpdate body = default(ResourceForUpdate), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, body, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - public static void Delete(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName) - { - operations.DeleteAsync(resourceGroupName, dataCollectionRuleName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a data collection rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IDataCollectionRules operations, string resourceGroupName, string dataCollectionRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, dataCollectionRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRulesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRulesOperations.cs index 9a365ee836ed..b795ded7566d 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRulesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IAlertRulesOperations.cs @@ -66,7 +66,7 @@ public partial interface IAlertRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -88,7 +88,7 @@ public partial interface IAlertRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -139,7 +139,7 @@ public partial interface IAlertRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -158,7 +158,7 @@ public partial interface IAlertRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociations.cs deleted file mode 100644 index cdceddf6a90a..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRuleAssociations.cs +++ /dev/null @@ -1,146 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor -{ - using Microsoft.Rest; - - using Models; - - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// DataCollectionRuleAssociations operations. - /// - public partial interface IDataCollectionRuleAssociations - { - /// - /// Lists associations for the specified resource. - /// - /// - /// The identifier of the resource. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceWithHttpMessagesAsync(string resourceUri, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists associations for the specified data collection rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByRuleWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Returns the specified association. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates an association. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The payload - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(string resourceUri, string associationName, DataCollectionRuleAssociationProxyOnlyResource body = default(DataCollectionRuleAssociationProxyOnlyResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an association. - /// - /// - /// The identifier of the resource. - /// - /// - /// The name of the association. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceUri, string associationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRules.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRules.cs deleted file mode 100644 index 1002215a1d47..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IDataCollectionRules.cs +++ /dev/null @@ -1,168 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor -{ - using Microsoft.Rest; - - using Models; - - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// DataCollectionRules operations. - /// - public partial interface IDataCollectionRules - { - /// - /// Lists all data collection rules in the specified resource group. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all data collection rules in the specified subscription. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Returns the specified data collection rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a data collection rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, DataCollectionRuleResource body = default(DataCollectionRuleResource), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates part of a data collection rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The payload - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, ResourceForUpdate body = default(ResourceForUpdate), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a data collection rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the data collection rule. The name is case insensitive. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string dataCollectionRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs index ec52f97ca1dc..e16e06fabb0d 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricAlertsOperations.cs @@ -160,7 +160,7 @@ public partial interface IMetricAlertsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricBaselineOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricBaselineOperations.cs deleted file mode 100644 index fa417ecdba12..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMetricBaselineOperations.cs +++ /dev/null @@ -1,102 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// MetricBaselineOperations operations. - /// - public partial interface IMetricBaselineOperations - { - /// - /// **Gets the baseline values for a specific metric**. - /// - /// - /// 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 - /// - /// - /// The name of the metric to retrieve the baseline for. - /// - /// - /// The timespan of the query. It is a string with the following format - /// 'startDateTime_ISO/endDateTime_ISO'. - /// - /// - /// The interval (i.e. timegrain) of the query. - /// - /// - /// The aggregation type of the metric to retrieve the baseline for. - /// - /// - /// The list of sensitivities (comma separated) to retrieve. - /// - /// - /// Allows retrieving only metadata of the baseline. On data request - /// all information is retrieved. Possible values include: 'Data', - /// 'Metadata' - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// **Lists the baseline values for a resource**. - /// - /// - /// 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 - /// - /// - /// Information that need to be specified to calculate a baseline on a - /// time series. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CalculateBaselineWithHttpMessagesAsync(string resourceUri, TimeSeriesInformation timeSeriesInformation, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs index dc566c7a4057..a1171c92e861 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IMonitorManagementClient.cs @@ -41,7 +41,7 @@ public partial interface IMonitorManagementClient : System.IDisposable ServiceClientCredentials Credentials { get; } /// - /// The Azure subscription Id. + /// The ID of the target subscription. /// string SubscriptionId { get; set; } @@ -134,11 +134,6 @@ public partial interface IMonitorManagementClient : System.IDisposable /// IMetricsOperations Metrics { get; } - /// - /// Gets the IMetricBaselineOperations. - /// - IMetricBaselineOperations MetricBaseline { get; } - /// /// Gets the IBaselinesOperations. /// @@ -194,14 +189,5 @@ public partial interface IMonitorManagementClient : System.IDisposable /// IPrivateLinkScopedResourcesOperations PrivateLinkScopedResources { get; } - /// - /// Gets the IDataCollectionRules. - /// - IDataCollectionRules DataCollectionRules { get; } - - /// - /// Gets the IDataCollectionRuleAssociations. - /// - IDataCollectionRuleAssociations DataCollectionRuleAssociations { get; } } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IScheduledQueryRulesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IScheduledQueryRulesOperations.cs index ba4456ae5c1e..bd1675fdcd98 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IScheduledQueryRulesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/IScheduledQueryRulesOperations.cs @@ -42,7 +42,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -67,7 +67,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -95,7 +95,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -120,7 +120,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -139,7 +139,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -164,7 +164,7 @@ public partial interface IScheduledQueryRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs index 22c26c0894b2..476c7c5993e4 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/LogProfilesOperations.cs @@ -84,6 +84,13 @@ internal LogProfilesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -251,6 +258,13 @@ internal LogProfilesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -442,6 +456,13 @@ internal LogProfilesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -634,6 +655,13 @@ internal LogProfilesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (logProfileName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "logProfileName"); @@ -822,6 +850,13 @@ internal LogProfilesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2016-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs index 212520cb0f36..17b69e75be5f 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsOperations.cs @@ -80,6 +80,13 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2018-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -254,6 +261,13 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -437,6 +451,13 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -629,6 +650,13 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -836,6 +864,13 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1015,7 +1050,7 @@ internal MetricAlertsOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1033,6 +1068,13 @@ internal MetricAlertsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -1126,14 +1168,13 @@ internal MetricAlertsOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1143,10 +1184,6 @@ internal MetricAlertsOperations(MonitorManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs index 2fc747a55751..09d82122d200 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricAlertsStatusOperations.cs @@ -86,6 +86,13 @@ internal MetricAlertsStatusOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -278,6 +285,13 @@ internal MetricAlertsStatusOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperations.cs deleted file mode 100644 index 048ca649aaf3..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperations.cs +++ /dev/null @@ -1,480 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// MetricBaselineOperations operations. - /// - internal partial class MetricBaselineOperations : IServiceOperations, IMetricBaselineOperations - { - /// - /// Initializes a new instance of the MetricBaselineOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal MetricBaselineOperations(MonitorManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the MonitorManagementClient - /// - public MonitorManagementClient Client { get; private set; } - - /// - /// **Gets the baseline values for a specific metric**. - /// - /// - /// 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 - /// - /// - /// The name of the metric to retrieve the baseline for. - /// - /// - /// The timespan of the query. It is a string with the following format - /// 'startDateTime_ISO/endDateTime_ISO'. - /// - /// - /// The interval (i.e. timegrain) of the query. - /// - /// - /// The aggregation type of the metric to retrieve the baseline for. - /// - /// - /// The list of sensitivities (comma separated) to retrieve. - /// - /// - /// Allows retrieving only metadata of the baseline. On data request all - /// information is retrieved. Possible values include: 'Data', 'Metadata' - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceUri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); - } - if (metricName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "metricName"); - } - string apiVersion = "2017-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceUri", resourceUri); - tracingParameters.Add("metricName", metricName); - tracingParameters.Add("timespan", timespan); - tracingParameters.Add("interval", interval); - tracingParameters.Add("aggregation", aggregation); - tracingParameters.Add("sensitivities", sensitivities); - tracingParameters.Add("resultType", resultType); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/baseline/{metricName}").ToString(); - _url = _url.Replace("{resourceUri}", resourceUri); - _url = _url.Replace("{metricName}", System.Uri.EscapeDataString(metricName)); - List _queryParameters = new List(); - if (timespan != null) - { - _queryParameters.Add(string.Format("timespan={0}", System.Uri.EscapeDataString(timespan))); - } - if (interval != null) - { - _queryParameters.Add(string.Format("interval={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(interval, Client.SerializationSettings).Trim('"')))); - } - if (aggregation != null) - { - _queryParameters.Add(string.Format("aggregation={0}", System.Uri.EscapeDataString(aggregation))); - } - if (sensitivities != null) - { - _queryParameters.Add(string.Format("sensitivities={0}", System.Uri.EscapeDataString(sensitivities))); - } - if (resultType != null) - { - _queryParameters.Add(string.Format("resultType={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(resultType, Client.SerializationSettings).Trim('"')))); - } - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// **Lists the baseline values for a resource**. - /// - /// - /// 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 - /// - /// - /// Information that need to be specified to calculate a baseline on a time - /// series. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CalculateBaselineWithHttpMessagesAsync(string resourceUri, TimeSeriesInformation timeSeriesInformation, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (resourceUri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceUri"); - } - if (timeSeriesInformation == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "timeSeriesInformation"); - } - if (timeSeriesInformation != null) - { - timeSeriesInformation.Validate(); - } - string apiVersion = "2017-11-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceUri", resourceUri); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("timeSeriesInformation", timeSeriesInformation); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CalculateBaseline", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceUri}/providers/microsoft.insights/calculatebaseline").ToString(); - _url = _url.Replace("{resourceUri}", resourceUri); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(timeSeriesInformation != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(timeSeriesInformation, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperationsExtensions.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperationsExtensions.cs deleted file mode 100644 index 8cb8be9f8969..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MetricBaselineOperationsExtensions.cs +++ /dev/null @@ -1,153 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for MetricBaselineOperations. - /// - public static partial class MetricBaselineOperationsExtensions - { - /// - /// **Gets the baseline values for a specific metric**. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - /// - /// The name of the metric to retrieve the baseline for. - /// - /// - /// The timespan of the query. It is a string with the following format - /// 'startDateTime_ISO/endDateTime_ISO'. - /// - /// - /// The interval (i.e. timegrain) of the query. - /// - /// - /// The aggregation type of the metric to retrieve the baseline for. - /// - /// - /// The list of sensitivities (comma separated) to retrieve. - /// - /// - /// Allows retrieving only metadata of the baseline. On data request all - /// information is retrieved. Possible values include: 'Data', 'Metadata' - /// - public static BaselineResponse Get(this IMetricBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?)) - { - return operations.GetAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType).GetAwaiter().GetResult(); - } - - /// - /// **Gets the baseline values for a specific metric**. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - /// - /// The name of the metric to retrieve the baseline for. - /// - /// - /// The timespan of the query. It is a string with the following format - /// 'startDateTime_ISO/endDateTime_ISO'. - /// - /// - /// The interval (i.e. timegrain) of the query. - /// - /// - /// The aggregation type of the metric to retrieve the baseline for. - /// - /// - /// The list of sensitivities (comma separated) to retrieve. - /// - /// - /// Allows retrieving only metadata of the baseline. On data request all - /// information is retrieved. Possible values include: 'Data', 'Metadata' - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IMetricBaselineOperations operations, string resourceUri, string metricName, string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), string sensitivities = default(string), ResultType? resultType = default(ResultType?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, metricName, timespan, interval, aggregation, sensitivities, resultType, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// **Lists the baseline values for a resource**. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - /// - /// Information that need to be specified to calculate a baseline on a time - /// series. - /// - public static CalculateBaselineResponse CalculateBaseline(this IMetricBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation) - { - return operations.CalculateBaselineAsync(resourceUri, timeSeriesInformation).GetAwaiter().GetResult(); - } - - /// - /// **Lists the baseline values for a resource**. - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - /// - /// Information that need to be specified to calculate a baseline on a time - /// series. - /// - /// - /// The cancellation token. - /// - public static async Task CalculateBaselineAsync(this IMetricBaselineOperations operations, string resourceUri, TimeSeriesInformation timeSeriesInformation, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CalculateBaselineWithHttpMessagesAsync(resourceUri, timeSeriesInformation, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActionGroupResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActionGroupResource.cs index 20e0287652bc..66939ccef2cd 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActionGroupResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActionGroupResource.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Monitor.Models /// An action group resource. /// [Rest.Serialization.JsonTransformation] - public partial class ActionGroupResource : Resource + public partial class ActionGroupResource : AzureResource { /// /// Initializes a new instance of the ActionGroupResource class. @@ -43,6 +43,8 @@ public ActionGroupResource() /// Azure resource Id /// Azure resource name /// Azure resource type + /// Azure resource kind + /// Azure resource identity /// Resource tags /// The list of email receivers that are /// part of this action group. @@ -66,8 +68,8 @@ public ActionGroupResource() /// 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. - public ActionGroupResource(string location, string groupShortName, bool enabled, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList emailReceivers = default(IList), IList smsReceivers = default(IList), IList webhookReceivers = default(IList), IList itsmReceivers = default(IList), IList azureAppPushReceivers = default(IList), IList automationRunbookReceivers = default(IList), IList voiceReceivers = default(IList), IList logicAppReceivers = default(IList), IList azureFunctionReceivers = default(IList), IList armRoleReceivers = default(IList)) - : base(location, id, name, type, tags) + public ActionGroupResource(string location, string groupShortName, bool enabled, string id = default(string), string name = default(string), string type = default(string), string kind = default(string), string identity = default(string), IDictionary tags = default(IDictionary), IList emailReceivers = default(IList), IList smsReceivers = default(IList), IList webhookReceivers = default(IList), IList itsmReceivers = default(IList), IList azureAppPushReceivers = default(IList), IList automationRunbookReceivers = default(IList), IList voiceReceivers = default(IList), IList logicAppReceivers = default(IList), IList azureFunctionReceivers = default(IList), IList armRoleReceivers = default(IList)) + : base(location, id, name, type, kind, identity, tags) { GroupShortName = groupShortName; Enabled = enabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActivityLogAlertResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActivityLogAlertResource.cs index 8ca7e0796dbd..3d3ee5288001 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActivityLogAlertResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ActivityLogAlertResource.cs @@ -47,13 +47,24 @@ public ActivityLogAlertResource() /// Azure resource name /// Azure resource type /// Resource tags + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. /// Indicates whether this activity log alert is /// enabled. If an activity log alert is not enabled, then none of its /// actions will be activated. /// A description of this activity log /// alert. - public ActivityLogAlertResource(string location, IList scopes, ActivityLogAlertAllOfCondition condition, ActivityLogAlertActionList actions, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), bool? enabled = default(bool?), string description = default(string)) - : base(location, id, name, type, tags) + public ActivityLogAlertResource(string location, IList scopes, ActivityLogAlertAllOfCondition condition, ActivityLogAlertActionList actions, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), bool? enabled = default(bool?), string description = default(string)) + : base(location, id, name, type, tags, kind, etag) { Scopes = scopes; Enabled = enabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AggregationTypeEnum.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AggregationTypeEnum.cs new file mode 100644 index 000000000000..e2007d5c8ddc --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AggregationTypeEnum.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + + /// + /// Defines values for AggregationTypeEnum. + /// + public static class AggregationTypeEnum + { + public const string Average = "Average"; + public const string Count = "Count"; + public const string Minimum = "Minimum"; + public const string Maximum = "Maximum"; + public const string Total = "Total"; + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResource.cs index 3720c83e68d9..7c977c3b9741 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResource.cs @@ -45,20 +45,36 @@ public AlertRuleResource() /// Azure resource name /// Azure resource type /// Resource tags + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. /// the description of the alert rule that /// will be included in the alert email. + /// the provisioning state. + /// action that is performed when the alert rule + /// becomes active, and when an alert condition is resolved. /// the array of actions that are performed when /// the alert rule becomes active, and when an alert condition is /// resolved. /// Last time the rule was updated in /// ISO8601 format. - public AlertRuleResource(string location, string alertRuleResourceName, bool isEnabled, RuleCondition condition, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) - : base(location, id, name, type, tags) + public AlertRuleResource(string location, string alertRuleResourceName, bool isEnabled, RuleCondition condition, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), string description = default(string), string provisioningState = default(string), RuleAction action = default(RuleAction), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) + : base(location, id, name, type, tags, kind, etag) { AlertRuleResourceName = alertRuleResourceName; Description = description; + ProvisioningState = provisioningState; IsEnabled = isEnabled; Condition = condition; + Action = action; Actions = actions; LastUpdatedTime = lastUpdatedTime; CustomInit(); @@ -82,6 +98,12 @@ public AlertRuleResource() [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } + /// + /// Gets or sets the provisioning state. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + /// /// Gets or sets the flag that indicates whether the alert rule is /// enabled. @@ -96,6 +118,13 @@ public AlertRuleResource() [JsonProperty(PropertyName = "properties.condition")] public RuleCondition Condition { get; set; } + /// + /// Gets or sets action that is performed when the alert rule becomes + /// active, and when an alert condition is resolved. + /// + [JsonProperty(PropertyName = "properties.action")] + public RuleAction Action { get; set; } + /// /// Gets or sets the array of actions that are performed when the alert /// rule becomes active, and when an alert condition is resolved. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResourcePatch.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResourcePatch.cs index b80302c7690e..002d92250887 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResourcePatch.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AlertRuleResourcePatch.cs @@ -42,18 +42,23 @@ public AlertRuleResourcePatch() /// Resource tags /// the description of the alert rule that /// will be included in the alert email. + /// the provisioning state. + /// action that is performed when the alert rule + /// becomes active, and when an alert condition is resolved. /// the array of actions that are performed when /// the alert rule becomes active, and when an alert condition is /// resolved. /// Last time the rule was updated in /// ISO8601 format. - public AlertRuleResourcePatch(string name, bool isEnabled, RuleCondition condition, IDictionary tags = default(IDictionary), string description = default(string), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) + public AlertRuleResourcePatch(string name, bool isEnabled, RuleCondition condition, IDictionary tags = default(IDictionary), string description = default(string), string provisioningState = default(string), RuleAction action = default(RuleAction), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) { Tags = tags; Name = name; Description = description; + ProvisioningState = provisioningState; IsEnabled = isEnabled; Condition = condition; + Action = action; Actions = actions; LastUpdatedTime = lastUpdatedTime; CustomInit(); @@ -83,6 +88,12 @@ public AlertRuleResourcePatch() [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } + /// + /// Gets or sets the provisioning state. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + /// /// Gets or sets the flag that indicates whether the alert rule is /// enabled. @@ -97,6 +108,13 @@ public AlertRuleResourcePatch() [JsonProperty(PropertyName = "properties.condition")] public RuleCondition Condition { get; set; } + /// + /// Gets or sets action that is performed when the alert rule becomes + /// active, and when an alert condition is resolved. + /// + [JsonProperty(PropertyName = "properties.action")] + public RuleAction Action { get; set; } + /// /// Gets or sets the array of actions that are performed when the alert /// rule becomes active, and when an alert condition is resolved. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ArmRoleReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ArmRoleReceiver.cs index b6868eab8890..47589c3f584d 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ArmRoleReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ArmRoleReceiver.cs @@ -35,7 +35,7 @@ public ArmRoleReceiver() /// The arm role id. /// Indicates whether to use common /// alert schema. - public ArmRoleReceiver(string name, string roleId, bool useCommonAlertSchema) + public ArmRoleReceiver(string name, string roleId, bool? useCommonAlertSchema = default(bool?)) { Name = name; RoleId = roleId; @@ -65,7 +65,7 @@ public ArmRoleReceiver(string name, string roleId, bool useCommonAlertSchema) /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Validate the object. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutomationRunbookReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutomationRunbookReceiver.cs index 3acb0207fb46..3d140ce5dc95 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutomationRunbookReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutomationRunbookReceiver.cs @@ -38,12 +38,12 @@ public AutomationRunbookReceiver() /// to this runbook. /// Indicates whether this instance is /// global runbook. - /// Indicates whether to use common - /// alert schema. /// Indicates name of the webhook. /// The URI where webhooks should be /// sent. - public AutomationRunbookReceiver(string automationAccountId, string runbookName, string webhookResourceId, bool isGlobalRunbook, bool useCommonAlertSchema, string name = default(string), string serviceUri = default(string)) + /// Indicates whether to use common + /// alert schema. + public AutomationRunbookReceiver(string automationAccountId, string runbookName, string webhookResourceId, bool isGlobalRunbook, string name = default(string), string serviceUri = default(string), bool? useCommonAlertSchema = default(bool?)) { AutomationAccountId = automationAccountId; RunbookName = runbookName; @@ -101,7 +101,7 @@ public AutomationRunbookReceiver() /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Validate the object. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResource.cs index 7ce1047ae27f..cd8ea7d1cd49 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AutoscaleSettingResource.cs @@ -42,6 +42,17 @@ public AutoscaleSettingResource() /// Azure resource name /// Azure resource type /// Resource tags + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. /// the collection of /// notifications. /// the enabled flag. Specifies whether automatic @@ -51,8 +62,8 @@ public AutoscaleSettingResource() /// autoscale setting. /// the resource identifier of the /// resource that the autoscale setting should be added to. - public AutoscaleSettingResource(string location, IList profiles, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList notifications = default(IList), bool? enabled = default(bool?), string autoscaleSettingResourceName = default(string), string targetResourceUri = default(string)) - : base(location, id, name, type, tags) + public AutoscaleSettingResource(string location, IList profiles, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), IList notifications = default(IList), bool? enabled = default(bool?), string autoscaleSettingResourceName = default(string), string targetResourceUri = default(string)) + : base(location, id, name, type, tags, kind, etag) { Profiles = profiles; Notifications = notifications; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureFunctionReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureFunctionReceiver.cs index 9a0157305b0b..fcf2fd801cbd 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureFunctionReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureFunctionReceiver.cs @@ -40,7 +40,7 @@ public AzureFunctionReceiver() /// request sent to. /// Indicates whether to use common /// alert schema. - public AzureFunctionReceiver(string name, string functionAppResourceId, string functionName, string httpTriggerUrl, bool useCommonAlertSchema) + public AzureFunctionReceiver(string name, string functionAppResourceId, string functionName, string httpTriggerUrl, bool? useCommonAlertSchema = default(bool?)) { Name = name; FunctionAppResourceId = functionAppResourceId; @@ -84,7 +84,7 @@ public AzureFunctionReceiver(string name, string functionAppResourceId, string f /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Validate the object. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorMetricsDestination.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorMetricsDestination.cs deleted file mode 100644 index 024b31b45b87..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureMonitorMetricsDestination.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Azure Monitor Metrics destination. - /// - public partial class AzureMonitorMetricsDestination - { - /// - /// Initializes a new instance of the AzureMonitorMetricsDestination - /// class. - /// - public AzureMonitorMetricsDestination() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AzureMonitorMetricsDestination - /// class. - /// - /// A friendly name for the destination. - /// This name should be unique across all destinations (regardless of - /// type) within the data collection rule. - public AzureMonitorMetricsDestination(string name) - { - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a friendly name for the destination. - /// This name should be unique across all destinations (regardless of - /// type) within the data collection rule. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureResource.cs new file mode 100644 index 000000000000..1b1afcdc72f9 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/AzureResource.cs @@ -0,0 +1,116 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// An azure resource object + /// + public partial class AzureResource : IResource + { + /// + /// Initializes a new instance of the AzureResource class. + /// + public AzureResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureResource class. + /// + /// Resource location + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Azure resource kind + /// Azure resource identity + /// Resource tags + public AzureResource(string location, string id = default(string), string name = default(string), string type = default(string), string kind = default(string), string identity = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Type = type; + Kind = kind; + Identity = identity; + Location = location; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets azure resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets azure resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets azure resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets azure resource kind + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; private set; } + + /// + /// Gets azure resource identity + /// + [JsonProperty(PropertyName = "identity")] + public string Identity { get; private set; } + + /// + /// Gets or sets resource location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Baseline.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Baseline.cs deleted file mode 100644 index 2aefd3ac9a2c..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Baseline.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The baseline values for a single sensitivity value. - /// - public partial class Baseline - { - /// - /// Initializes a new instance of the Baseline class. - /// - public Baseline() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Baseline class. - /// - /// the sensitivity of the baseline. Possible - /// values include: 'Low', 'Medium', 'High' - /// The low thresholds of the - /// baseline. - /// The high thresholds of the - /// baseline. - public Baseline(Sensitivity sensitivity, IList lowThresholds, IList highThresholds) - { - Sensitivity = sensitivity; - LowThresholds = lowThresholds; - HighThresholds = highThresholds; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the sensitivity of the baseline. Possible values - /// include: 'Low', 'Medium', 'High' - /// - [JsonProperty(PropertyName = "sensitivity")] - public Sensitivity Sensitivity { get; set; } - - /// - /// Gets or sets the low thresholds of the baseline. - /// - [JsonProperty(PropertyName = "lowThresholds")] - public IList LowThresholds { get; set; } - - /// - /// Gets or sets the high thresholds of the baseline. - /// - [JsonProperty(PropertyName = "highThresholds")] - public IList HighThresholds { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (LowThresholds == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "LowThresholds"); - } - if (HighThresholds == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "HighThresholds"); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineMetadataValue.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineMetadataValue.cs deleted file mode 100644 index 637a70d9b84b..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineMetadataValue.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Represents a baseline metadata value. - /// - public partial class BaselineMetadataValue - { - /// - /// Initializes a new instance of the BaselineMetadataValue class. - /// - public BaselineMetadataValue() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BaselineMetadataValue class. - /// - /// the name of the metadata. - /// the value of the metadata. - public BaselineMetadataValue(LocalizableString name = default(LocalizableString), string value = default(string)) - { - Name = name; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the metadata. - /// - [JsonProperty(PropertyName = "name")] - public LocalizableString Name { get; set; } - - /// - /// Gets or sets the value of the metadata. - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name != null) - { - Name.Validate(); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineResponse.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineResponse.cs deleted file mode 100644 index cb3a7c95483f..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/BaselineResponse.cs +++ /dev/null @@ -1,171 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The response to a baseline query. - /// - [Rest.Serialization.JsonTransformation] - public partial class BaselineResponse - { - /// - /// Initializes a new instance of the BaselineResponse class. - /// - public BaselineResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BaselineResponse class. - /// - /// the metric baseline Id. - /// the resource type of the baseline - /// resource. - /// the name and the display name of the metric, - /// i.e. it is localizable string. - /// 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. - /// 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. - /// The aggregation type of the - /// metric. - /// the array of timestamps of the - /// baselines. - /// the baseline values for each - /// sensitivity. - /// the baseline metadata values. - public BaselineResponse(string id = default(string), string type = default(string), LocalizableString name = default(LocalizableString), string timespan = default(string), System.TimeSpan? interval = default(System.TimeSpan?), string aggregation = default(string), IList timestamps = default(IList), IList baseline = default(IList), IList metadata = default(IList)) - { - Id = id; - Type = type; - Name = name; - Timespan = timespan; - Interval = interval; - Aggregation = aggregation; - Timestamps = timestamps; - Baseline = baseline; - Metadata = metadata; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the metric baseline Id. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets the resource type of the baseline resource. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets the name and the display name of the metric, i.e. it is - /// localizable string. - /// - [JsonProperty(PropertyName = "name")] - public LocalizableString Name { get; private set; } - - /// - /// Gets or sets 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. - /// - [JsonProperty(PropertyName = "properties.timespan")] - public string Timespan { get; set; } - - /// - /// Gets or sets 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. - /// - [JsonProperty(PropertyName = "properties.interval")] - public System.TimeSpan? Interval { get; set; } - - /// - /// Gets or sets the aggregation type of the metric. - /// - [JsonProperty(PropertyName = "properties.aggregation")] - public string Aggregation { get; set; } - - /// - /// Gets or sets the array of timestamps of the baselines. - /// - [JsonProperty(PropertyName = "properties.timestamps")] - public IList Timestamps { get; set; } - - /// - /// Gets or sets the baseline values for each sensitivity. - /// - [JsonProperty(PropertyName = "properties.baseline")] - public IList Baseline { get; set; } - - /// - /// Gets or sets the baseline metadata values. - /// - [JsonProperty(PropertyName = "properties.metadata")] - public IList Metadata { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name != null) - { - Name.Validate(); - } - if (Baseline != null) - { - foreach (var element in Baseline) - { - if (element != null) - { - element.Validate(); - } - } - } - if (Metadata != null) - { - foreach (var element1 in Metadata) - { - if (element1 != null) - { - element1.Validate(); - } - } - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/CalculateBaselineResponse.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/CalculateBaselineResponse.cs deleted file mode 100644 index f635318ab02e..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/CalculateBaselineResponse.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The response to a calculate baseline call. - /// - public partial class CalculateBaselineResponse - { - /// - /// Initializes a new instance of the CalculateBaselineResponse class. - /// - public CalculateBaselineResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CalculateBaselineResponse class. - /// - /// the resource type of the baseline - /// resource. - /// the baseline values for each - /// sensitivity. - /// the array of timestamps of the - /// baselines. - public CalculateBaselineResponse(string type, IList baseline, IList timestamps = default(IList)) - { - Type = type; - Timestamps = timestamps; - Baseline = baseline; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource type of the baseline resource. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets the array of timestamps of the baselines. - /// - [JsonProperty(PropertyName = "timestamps")] - public IList Timestamps { get; set; } - - /// - /// Gets or sets the baseline values for each sensitivity. - /// - [JsonProperty(PropertyName = "baseline")] - public IList Baseline { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Type == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); - } - if (Baseline == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Baseline"); - } - if (Baseline != null) - { - foreach (var element in Baseline) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ConditionalOperator.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ConditionalOperator.cs index 98d5f8fd2d69..1be56cc4dae5 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ConditionalOperator.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ConditionalOperator.cs @@ -16,6 +16,8 @@ namespace Microsoft.Azure.Management.Monitor.Models /// public static class ConditionalOperator { + public const string GreaterThanOrEqual = "GreaterThanOrEqual"; + public const string LessThanOrEqual = "LessThanOrEqual"; public const string GreaterThan = "GreaterThan"; public const string LessThan = "LessThan"; public const string Equal = "Equal"; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResource.cs deleted file mode 100644 index 96789654534d..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleAssociationProxyOnlyResource.cs +++ /dev/null @@ -1,96 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - - /// - /// Definition of generic ARM proxy resource. - /// - [Rest.Serialization.JsonTransformation] - public partial class DataCollectionRuleAssociationProxyOnlyResource : ProxyOnlyResource - { - /// - /// Initializes a new instance of the - /// DataCollectionRuleAssociationProxyOnlyResource class. - /// - public DataCollectionRuleAssociationProxyOnlyResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// DataCollectionRuleAssociationProxyOnlyResource class. - /// - /// The resource ID of the data - /// collection rule that is to be associated. - /// Description of the association. - /// The resource provisioning state. - /// Possible values include: 'Creating', 'Updating', 'Deleting', - /// 'Succeeded', 'Failed' - /// Fully qualified ID of the resource. - /// The name of the resource. - /// The type of the resource. - /// Resource entity tag (ETag). - public DataCollectionRuleAssociationProxyOnlyResource(string dataCollectionRuleId, string description = default(string), string provisioningState = default(string), string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(id, name, type) - { - Description = description; - DataCollectionRuleId = dataCollectionRuleId; - ProvisioningState = provisioningState; - Etag = etag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets description of the association. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the resource ID of the data collection rule that is to - /// be associated. - /// - [JsonProperty(PropertyName = "properties.dataCollectionRuleId")] - public string DataCollectionRuleId { get; set; } - - /// - /// Gets the resource provisioning state. Possible values include: - /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets resource entity tag (ETag). - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DataCollectionRuleId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataCollectionRuleId"); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDataSources.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDataSources.cs deleted file mode 100644 index a8f31f4b717d..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDataSources.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The specification of data sources. - /// This property is optional and can be omitted if the rule is meant to be - /// used via direct calls to the provisioned endpoint. - /// - public partial class DataCollectionRuleDataSources : DataSourcesSpec - { - /// - /// Initializes a new instance of the DataCollectionRuleDataSources - /// class. - /// - public DataCollectionRuleDataSources() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataCollectionRuleDataSources - /// class. - /// - /// The list of performance counter - /// data source configurations. - /// The list of Windows Event Log data - /// source configurations. - /// The list of Syslog data source - /// configurations. - /// The list of Azure VM extension data source - /// configurations. - public DataCollectionRuleDataSources(IList performanceCounters = default(IList), IList windowsEventLogs = default(IList), IList syslog = default(IList), IList extensions = default(IList)) - : base(performanceCounters, windowsEventLogs, syslog, extensions) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDestinations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDestinations.cs deleted file mode 100644 index 99cb30cf9902..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleDestinations.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The specification of destinations. - /// - public partial class DataCollectionRuleDestinations : DestinationsSpec - { - /// - /// Initializes a new instance of the DataCollectionRuleDestinations - /// class. - /// - public DataCollectionRuleDestinations() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataCollectionRuleDestinations - /// class. - /// - /// List of Log Analytics - /// destinations. - /// Azure Monitor Metrics - /// destination. - public DataCollectionRuleDestinations(IList logAnalytics = default(IList), DestinationsSpecAzureMonitorMetrics azureMonitorMetrics = default(DestinationsSpecAzureMonitorMetrics)) - : base(logAnalytics, azureMonitorMetrics) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResource.cs deleted file mode 100644 index 4d31b6a37da8..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataCollectionRuleResource.cs +++ /dev/null @@ -1,139 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections.Generic; - - /// - /// Definition of ARM tracked top level resource. - /// - [Rest.Serialization.JsonTransformation] - public partial class DataCollectionRuleResource : Resource - { - /// - /// Initializes a new instance of the DataCollectionRuleResource class. - /// - public DataCollectionRuleResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataCollectionRuleResource class. - /// - /// The specification of - /// destinations. - /// The specification of data flows. - /// The geo-location where the resource - /// lives. - /// Description of the data collection - /// rule. - /// The specification of data sources. - /// This property is optional and can be omitted if the rule is meant - /// to be used via direct calls to the provisioned endpoint. - /// The resource provisioning state. - /// Possible values include: 'Creating', 'Updating', 'Deleting', - /// 'Succeeded', 'Failed' - /// Resource tags. - /// Fully qualified ID of the resource. - /// The name of the resource. - /// The type of the resource. - /// Resource entity tag (ETag). - public DataCollectionRuleResource(DataCollectionRuleDestinations destinations, IList dataFlows, string location, string description = default(string), DataCollectionRuleDataSources dataSources = default(DataCollectionRuleDataSources), string provisioningState = default(string), IDictionary tags = default(IDictionary), string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(location, id, name, type, tags) - { - Description = description; - DataSources = dataSources; - Destinations = destinations; - DataFlows = dataFlows; - ProvisioningState = provisioningState; - Location = location; - Etag = etag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets description of the data collection rule. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the specification of data sources. - /// This property is optional and can be omitted if the rule is meant - /// to be used via direct calls to the provisioned endpoint. - /// - [JsonProperty(PropertyName = "properties.dataSources")] - public DataCollectionRuleDataSources DataSources { get; set; } - - /// - /// Gets or sets the specification of destinations. - /// - [JsonProperty(PropertyName = "properties.destinations")] - public DataCollectionRuleDestinations Destinations { get; set; } - - /// - /// Gets or sets the specification of data flows. - /// - [JsonProperty(PropertyName = "properties.dataFlows")] - public IList DataFlows { get; set; } - - /// - /// Gets the resource provisioning state. Possible values include: - /// 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets resource entity tag (ETag). - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - - if (Destinations == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Destinations"); - } - if (DataFlows == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataFlows"); - } - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - if (DataFlows != null) - { - foreach (var element in DataFlows) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataFlow.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataFlow.cs deleted file mode 100644 index 9415dd42828a..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataFlow.cs +++ /dev/null @@ -1,76 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Definition of which streams are sent to which destinations. - /// - public partial class DataFlow - { - /// - /// Initializes a new instance of the DataFlow class. - /// - public DataFlow() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataFlow class. - /// - /// List of streams for this data flow. - /// List of destinations for this data - /// flow. - public DataFlow(IList streams, IList destinations) - { - Streams = streams; - Destinations = destinations; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of streams for this data flow. - /// - [JsonProperty(PropertyName = "streams")] - public IList Streams { get; set; } - - /// - /// Gets or sets list of destinations for this data flow. - /// - [JsonProperty(PropertyName = "destinations")] - public IList Destinations { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Streams == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Streams"); - } - if (Destinations == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Destinations"); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataSourcesSpec.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataSourcesSpec.cs deleted file mode 100644 index f66eda00cfff..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DataSourcesSpec.cs +++ /dev/null @@ -1,80 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Specification of data sources that will be collected. - /// - public partial class DataSourcesSpec - { - /// - /// Initializes a new instance of the DataSourcesSpec class. - /// - public DataSourcesSpec() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataSourcesSpec class. - /// - /// The list of performance counter - /// data source configurations. - /// The list of Windows Event Log data - /// source configurations. - /// The list of Syslog data source - /// configurations. - /// The list of Azure VM extension data source - /// configurations. - public DataSourcesSpec(IList performanceCounters = default(IList), IList windowsEventLogs = default(IList), IList syslog = default(IList), IList extensions = default(IList)) - { - PerformanceCounters = performanceCounters; - WindowsEventLogs = windowsEventLogs; - Syslog = syslog; - Extensions = extensions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the list of performance counter data source - /// configurations. - /// - [JsonProperty(PropertyName = "performanceCounters")] - public IList PerformanceCounters { get; set; } - - /// - /// Gets or sets the list of Windows Event Log data source - /// configurations. - /// - [JsonProperty(PropertyName = "windowsEventLogs")] - public IList WindowsEventLogs { get; set; } - - /// - /// Gets or sets the list of Syslog data source configurations. - /// - [JsonProperty(PropertyName = "syslog")] - public IList Syslog { get; set; } - - /// - /// Gets or sets the list of Azure VM extension data source - /// configurations. - /// - [JsonProperty(PropertyName = "extensions")] - public IList Extensions { get; set; } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpec.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpec.cs deleted file mode 100644 index 5288b0fb67ec..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpec.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Specification of destinations that can be used in data flows. - /// - public partial class DestinationsSpec - { - /// - /// Initializes a new instance of the DestinationsSpec class. - /// - public DestinationsSpec() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DestinationsSpec class. - /// - /// List of Log Analytics - /// destinations. - /// Azure Monitor Metrics - /// destination. - public DestinationsSpec(IList logAnalytics = default(IList), DestinationsSpecAzureMonitorMetrics azureMonitorMetrics = default(DestinationsSpecAzureMonitorMetrics)) - { - LogAnalytics = logAnalytics; - AzureMonitorMetrics = azureMonitorMetrics; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of Log Analytics destinations. - /// - [JsonProperty(PropertyName = "logAnalytics")] - public IList LogAnalytics { get; set; } - - /// - /// Gets or sets azure Monitor Metrics destination. - /// - [JsonProperty(PropertyName = "azureMonitorMetrics")] - public DestinationsSpecAzureMonitorMetrics AzureMonitorMetrics { get; set; } - - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpecAzureMonitorMetrics.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpecAzureMonitorMetrics.cs deleted file mode 100644 index 93d723887d24..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DestinationsSpecAzureMonitorMetrics.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using System.Linq; - - /// - /// Azure Monitor Metrics destination. - /// - public partial class DestinationsSpecAzureMonitorMetrics : AzureMonitorMetricsDestination - { - /// - /// Initializes a new instance of the - /// DestinationsSpecAzureMonitorMetrics class. - /// - public DestinationsSpecAzureMonitorMetrics() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// DestinationsSpecAzureMonitorMetrics class. - /// - /// A friendly name for the destination. - /// This name should be unique across all destinations (regardless of - /// type) within the data collection rule. - public DestinationsSpecAzureMonitorMetrics(string name) - : base(name) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DynamicMetricCriteria.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DynamicMetricCriteria.cs index 7b8099392e66..8dad3fa1d3f0 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DynamicMetricCriteria.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/DynamicMetricCriteria.cs @@ -35,8 +35,9 @@ public DynamicMetricCriteria() /// /// Name of the criteria. /// Name of the metric. - /// the criteria time aggregation - /// types. + /// the criteria time aggregation types. + /// Possible values include: 'Average', 'Count', 'Minimum', 'Maximum', + /// 'Total' /// The operator used to compare the /// metric value against the threshold. Possible values include: /// 'GreaterThan', 'LessThan', 'GreaterOrLessThan' @@ -57,7 +58,7 @@ public DynamicMetricCriteria() /// Use this option to set the date from /// which to start learning the metric historical data and calculate /// the dynamic thresholds (in ISO8601 format) - public DynamicMetricCriteria(string name, string metricName, object timeAggregation, string operatorProperty, string alertSensitivity, DynamicThresholdFailingPeriods failingPeriods, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?), System.DateTime? ignoreDataBefore = default(System.DateTime?)) + public DynamicMetricCriteria(string name, string metricName, string timeAggregation, string operatorProperty, string alertSensitivity, DynamicThresholdFailingPeriods failingPeriods, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?), System.DateTime? ignoreDataBefore = default(System.DateTime?)) : base(name, metricName, timeAggregation, additionalProperties, metricNamespace, dimensions, skipMetricValidation) { OperatorProperty = operatorProperty; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/EmailReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/EmailReceiver.cs index edd022c9f92f..e760d09e03c9 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/EmailReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/EmailReceiver.cs @@ -38,7 +38,7 @@ public EmailReceiver() /// alert schema. /// The receiver status of the e-mail. Possible /// values include: 'NotSpecified', 'Enabled', 'Disabled' - public EmailReceiver(string name, string emailAddress, bool useCommonAlertSchema, ReceiverStatus? status = default(ReceiverStatus?)) + public EmailReceiver(string name, string emailAddress, bool? useCommonAlertSchema = default(bool?), ReceiverStatus? status = default(ReceiverStatus?)) { Name = name; EmailAddress = emailAddress; @@ -69,7 +69,7 @@ public EmailReceiver() /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Gets the receiver status of the e-mail. Possible values include: diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ResourceForUpdate.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContract.cs similarity index 51% rename from sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ResourceForUpdate.cs rename to sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContract.cs index 5c42e64be82b..ef68c2f6c9cb 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ResourceForUpdate.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContract.cs @@ -1,4 +1,8 @@ // +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. @@ -7,31 +11,28 @@ namespace Microsoft.Azure.Management.Monitor.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Definition of ARM tracked top level resource properties for update - /// operation. + /// Describes the format of Error response. /// - public partial class ResourceForUpdate + public partial class ErrorContract { /// - /// Initializes a new instance of the ResourceForUpdate class. + /// Initializes a new instance of the ErrorContract class. /// - public ResourceForUpdate() + public ErrorContract() { CustomInit(); } /// - /// Initializes a new instance of the ResourceForUpdate class. + /// Initializes a new instance of the ErrorContract class. /// - /// Resource tags. - public ResourceForUpdate(IDictionary tags = default(IDictionary)) + /// The error details. + public ErrorContract(ErrorResponse error = default(ErrorResponse)) { - Tags = tags; + Error = error; CustomInit(); } @@ -41,10 +42,10 @@ public ResourceForUpdate() partial void CustomInit(); /// - /// Gets or sets resource tags. + /// Gets or sets the error details. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [JsonProperty(PropertyName = "error")] + public ErrorResponse Error { get; set; } } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContractException.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContractException.cs new file mode 100644 index 000000000000..1c4394eebbbe --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ErrorContractException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorContract + /// information. + /// + public partial class ErrorContractException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorContract Body { get; set; } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + public ErrorContractException() + { + } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + /// The exception message. + public ErrorContractException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorContractException class. + /// + /// The exception message. + /// Inner exception. + public ErrorContractException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ExtensionDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ExtensionDataSource.cs deleted file mode 100644 index be46e72de05a..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/ExtensionDataSource.cs +++ /dev/null @@ -1,110 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Definition of which data will be collected from a separate VM extension - /// that integrates with the Azure Monitor Agent. - /// Collected from either Windows and Linux machines, depending on which - /// extension is defined. - /// - public partial class ExtensionDataSource - { - /// - /// Initializes a new instance of the ExtensionDataSource class. - /// - public ExtensionDataSource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ExtensionDataSource class. - /// - /// List of streams that this data source will be - /// sent to. - /// A stream indicates what schema will be used for this data and - /// usually what table in Log Analytics the data will be sent - /// to. - /// The name of the VM extension. - /// A friendly name for the data source. - /// This name should be unique across all data sources (regardless of - /// type) within the data collection rule. - /// The extension settings. The format - /// is specific for particular extension. - public ExtensionDataSource(IList streams, string extensionName, string name, object extensionSettings = default(object)) - { - Streams = streams; - ExtensionName = extensionName; - ExtensionSettings = extensionSettings; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of streams that this data source will be sent to. - /// A stream indicates what schema will be used for this data and - /// usually what table in Log Analytics the data will be sent to. - /// - [JsonProperty(PropertyName = "streams")] - public IList Streams { get; set; } - - /// - /// Gets or sets the name of the VM extension. - /// - [JsonProperty(PropertyName = "extensionName")] - public string ExtensionName { get; set; } - - /// - /// Gets or sets the extension settings. The format is specific for - /// particular extension. - /// - [JsonProperty(PropertyName = "extensionSettings")] - public object ExtensionSettings { get; set; } - - /// - /// Gets or sets a friendly name for the data source. - /// This name should be unique across all data sources (regardless of - /// type) within the data collection rule. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Streams == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Streams"); - } - if (ExtensionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ExtensionName"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogAnalyticsDestination.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogAnalyticsDestination.cs deleted file mode 100644 index 8d2e2410d2a1..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogAnalyticsDestination.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Log Analytics destination. - /// - public partial class LogAnalyticsDestination - { - /// - /// Initializes a new instance of the LogAnalyticsDestination class. - /// - public LogAnalyticsDestination() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LogAnalyticsDestination class. - /// - /// The resource ID of the Log - /// Analytics workspace. - /// A friendly name for the destination. - /// This name should be unique across all destinations (regardless of - /// type) within the data collection rule. - public LogAnalyticsDestination(string workspaceResourceId, string name) - { - WorkspaceResourceId = workspaceResourceId; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the Log Analytics workspace. - /// - [JsonProperty(PropertyName = "workspaceResourceId")] - public string WorkspaceResourceId { get; set; } - - /// - /// Gets or sets a friendly name for the destination. - /// This name should be unique across all destinations (regardless of - /// type) within the data collection rule. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (WorkspaceResourceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "WorkspaceResourceId"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogMetricTrigger.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogMetricTrigger.cs index 6c0adfc1c88d..a516b0394529 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogMetricTrigger.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogMetricTrigger.cs @@ -31,7 +31,8 @@ public LogMetricTrigger() /// /// Evaluation operation for Metric /// -'GreaterThan' or 'LessThan' or 'Equal'. Possible values include: - /// 'GreaterThan', 'LessThan', 'Equal' + /// 'GreaterThanOrEqual', 'LessThanOrEqual', 'GreaterThan', 'LessThan', + /// 'Equal' /// The threshold of the metric /// trigger. /// Metric Trigger Type - 'Consecutive' @@ -54,8 +55,9 @@ public LogMetricTrigger() /// /// Gets or sets evaluation operation for Metric -'GreaterThan' or - /// 'LessThan' or 'Equal'. Possible values include: 'GreaterThan', - /// 'LessThan', 'Equal' + /// 'LessThan' or 'Equal'. Possible values include: + /// 'GreaterThanOrEqual', 'LessThanOrEqual', 'GreaterThan', 'LessThan', + /// 'Equal' /// [JsonProperty(PropertyName = "thresholdOperator")] public string ThresholdOperator { get; set; } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogProfileResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogProfileResource.cs index a709d9399b93..166a52e4c6d9 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogProfileResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogProfileResource.cs @@ -47,6 +47,17 @@ public LogProfileResource() /// Azure resource name /// Azure resource type /// Resource tags + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. /// the resource id of the storage /// account to which you would like to send the Activity Log. /// The service bus rule ID of the @@ -54,8 +65,8 @@ public LogProfileResource() /// created for streaming the Activity Log. The rule ID is of the /// format: '{service bus resource ID}/authorizationrules/{key /// name}'. - public LogProfileResource(string location, IList locations, IList categories, RetentionPolicy retentionPolicy, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string)) - : base(location, id, name, type, tags) + public LogProfileResource(string location, IList locations, IList categories, RetentionPolicy retentionPolicy, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), string storageAccountId = default(string), string serviceBusRuleId = default(string)) + : base(location, id, name, type, tags, kind, etag) { StorageAccountId = storageAccountId; ServiceBusRuleId = serviceBusRuleId; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogSearchRuleResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogSearchRuleResource.cs index e206d0bfb9e6..b7965a832ee0 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogSearchRuleResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogSearchRuleResource.cs @@ -43,8 +43,28 @@ public LogSearchRuleResource() /// Azure resource name /// Azure resource type /// Resource tags + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. + /// The api-version used when + /// creating this alert rule + /// True if alert rule is legacy + /// Log Analytic rule /// The description of the Log Search /// rule. + /// The display name of the alert + /// rule + /// The flag that indicates whether the + /// alert should be automatically resolved or not. The default is + /// false. /// The flag which indicates whether the Log /// Search rule is enabled. Value should be true or false. Possible /// values include: 'true', 'false' @@ -55,10 +75,14 @@ public LogSearchRuleResource() /// 'Canceled', 'Failed' /// Schedule (Frequency, Time Window) for rule. /// Required for action type - AlertingAction - public LogSearchRuleResource(string location, Source source, Action action, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string description = default(string), string enabled = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), string provisioningState = default(string), Schedule schedule = default(Schedule)) - : base(location, id, name, type, tags) + public LogSearchRuleResource(string location, Source source, Action action, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), string createdWithApiVersion = default(string), bool? isLegacyLogAnalyticsRule = default(bool?), string description = default(string), string displayName = default(string), bool? autoMitigate = default(bool?), string enabled = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), string provisioningState = default(string), Schedule schedule = default(Schedule)) + : base(location, id, name, type, tags, kind, etag) { + CreatedWithApiVersion = createdWithApiVersion; + IsLegacyLogAnalyticsRule = isLegacyLogAnalyticsRule; Description = description; + DisplayName = displayName; + AutoMitigate = autoMitigate; Enabled = enabled; LastUpdatedTime = lastUpdatedTime; ProvisioningState = provisioningState; @@ -73,12 +97,37 @@ public LogSearchRuleResource() /// partial void CustomInit(); + /// + /// Gets the api-version used when creating this alert rule + /// + [JsonProperty(PropertyName = "properties.createdWithApiVersion")] + public string CreatedWithApiVersion { get; private set; } + + /// + /// Gets true if alert rule is legacy Log Analytic rule + /// + [JsonProperty(PropertyName = "properties.isLegacyLogAnalyticsRule")] + public bool? IsLegacyLogAnalyticsRule { get; private set; } + /// /// Gets or sets the description of the Log Search rule. /// [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } + /// + /// Gets or sets the display name of the alert rule + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the flag that indicates whether the alert should be + /// automatically resolved or not. The default is false. + /// + [JsonProperty(PropertyName = "properties.autoMitigate")] + public bool? AutoMitigate { get; set; } + /// /// Gets or sets the flag which indicates whether the Log Search rule /// is enabled. Value should be true or false. Possible values include: diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogicAppReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogicAppReceiver.cs index 862a2a8dd73f..f12ad85de299 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogicAppReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/LogicAppReceiver.cs @@ -38,7 +38,7 @@ public LogicAppReceiver() /// to. /// Indicates whether to use common /// alert schema. - public LogicAppReceiver(string name, string resourceId, string callbackUrl, bool useCommonAlertSchema) + public LogicAppReceiver(string name, string resourceId, string callbackUrl, bool? useCommonAlertSchema = default(bool?)) { Name = name; ResourceId = resourceId; @@ -75,7 +75,7 @@ public LogicAppReceiver(string name, string resourceId, string callbackUrl, bool /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Validate the object. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Metric.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Metric.cs index c2748c6b6bb0..2f90fb2124c3 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Metric.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Metric.cs @@ -37,17 +37,23 @@ public Metric() /// resource. /// the name and the display name of the metric, /// i.e. it is localizable string. + /// Detailed description of this + /// metric. /// the unit of the metric. Possible values include: /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', /// 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified', 'Cores', /// 'MilliCores', 'NanoCores', 'BitsPerSecond' /// the time series returned when a data query /// is performed. - public Metric(string id, string type, LocalizableString name, Unit unit, IList timeseries) + /// 'Success' or the error details on query + /// failures for this metric. + public Metric(string id, string type, LocalizableString name, string displayDescription, Unit unit, IList timeseries, string errorCode = default(string)) { Id = id; Type = type; Name = name; + DisplayDescription = displayDescription; + ErrorCode = errorCode; Unit = unit; Timeseries = timeseries; CustomInit(); @@ -77,6 +83,19 @@ public Metric(string id, string type, LocalizableString name, Unit unit, IList + /// Gets or sets detailed description of this metric. + /// + [JsonProperty(PropertyName = "displayDescription")] + public string DisplayDescription { get; set; } + + /// + /// Gets or sets 'Success' or the error details on query failures for + /// this metric. + /// + [JsonProperty(PropertyName = "errorCode")] + public string ErrorCode { get; set; } + /// /// Gets or sets the unit of the metric. Possible values include: /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', @@ -113,6 +132,10 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } + if (DisplayDescription == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DisplayDescription"); + } if (Timeseries == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Timeseries"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertAction.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertAction.cs index b350094e1de4..34d8307f5947 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertAction.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertAction.cs @@ -33,8 +33,9 @@ public MetricAlertAction() /// /// the id of the action group to /// use. - /// The properties of a webhook - /// object. + /// This field allows specifying custom + /// properties, which would be appended to the alert payload sent as + /// input to the webhook. public MetricAlertAction(string actionGroupId = default(string), IDictionary webHookProperties = default(IDictionary)) { ActionGroupId = actionGroupId; @@ -54,7 +55,9 @@ public MetricAlertAction() public string ActionGroupId { get; set; } /// - /// Gets or sets the properties of a webhook object. + /// Gets or sets this field allows specifying custom properties, which + /// would be appended to the alert payload sent as input to the + /// webhook. /// [JsonProperty(PropertyName = "webHookProperties")] public IDictionary WebHookProperties { get; set; } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResource.cs index 1dc4c60ad162..4a9a864de888 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResource.cs @@ -35,11 +35,11 @@ public MetricAlertResource() /// Initializes a new instance of the MetricAlertResource class. /// /// Resource location - /// the description of the metric alert that - /// will be included in the alert email. /// Alert severity {0, 1, 2, 3, 4} /// the flag that indicates whether the metric /// alert is enabled. + /// the list of resource id's that this metric + /// alert is scoped to. /// how often the metric alert is /// evaluated represented in ISO 8601 duration format. /// the period of time (in ISO 8601 duration @@ -51,14 +51,27 @@ public MetricAlertResource() /// Azure resource name /// Azure resource type /// Resource tags - /// the list of resource id's that this metric - /// alert is scoped to. + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. + /// the description of the metric alert that + /// will be included in the alert email. /// the resource type of the target - /// resource(s) on which the alert is created/updated. Mandatory for - /// MultipleResourceMultipleMetricCriteria. + /// resource(s) on which the alert is created/updated. Mandatory if the + /// scope contains a subscription, resource group, or more than one + /// resource. /// the region of the target - /// resource(s) on which the alert is created/updated. Mandatory for - /// MultipleResourceMultipleMetricCriteria. + /// resource(s) on which the alert is created/updated. Mandatory if the + /// scope contains a subscription, resource group, or more than one + /// resource. /// the flag that indicates whether the /// alert should be auto resolved or not. The default is true. /// the array of actions that are performed when @@ -66,8 +79,10 @@ public MetricAlertResource() /// resolved. /// Last time the rule was updated in /// ISO8601 format. - public MetricAlertResource(string location, string description, int severity, bool enabled, System.TimeSpan evaluationFrequency, System.TimeSpan windowSize, MetricAlertCriteria criteria, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList scopes = default(IList), string targetResourceType = default(string), string targetResourceRegion = default(string), bool? autoMitigate = default(bool?), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) - : base(location, id, name, type, tags) + /// the value indicating whether this alert + /// rule is migrated. + public MetricAlertResource(string location, int severity, bool enabled, IList scopes, System.TimeSpan evaluationFrequency, System.TimeSpan windowSize, MetricAlertCriteria criteria, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string), string description = default(string), string targetResourceType = default(string), string targetResourceRegion = default(string), bool? autoMitigate = default(bool?), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?), bool? isMigrated = default(bool?)) + : base(location, id, name, type, tags, kind, etag) { Description = description; Severity = severity; @@ -81,6 +96,7 @@ public MetricAlertResource() AutoMitigate = autoMitigate; Actions = actions; LastUpdatedTime = lastUpdatedTime; + IsMigrated = isMigrated; CustomInit(); } @@ -132,16 +148,16 @@ public MetricAlertResource() /// /// Gets or sets the resource type of the target resource(s) on which - /// the alert is created/updated. Mandatory for - /// MultipleResourceMultipleMetricCriteria. + /// the alert is created/updated. Mandatory if the scope contains a + /// subscription, resource group, or more than one resource. /// [JsonProperty(PropertyName = "properties.targetResourceType")] public string TargetResourceType { get; set; } /// /// Gets or sets the region of the target resource(s) on which the - /// alert is created/updated. Mandatory for - /// MultipleResourceMultipleMetricCriteria. + /// alert is created/updated. Mandatory if the scope contains a + /// subscription, resource group, or more than one resource. /// [JsonProperty(PropertyName = "properties.targetResourceRegion")] public string TargetResourceRegion { get; set; } @@ -172,6 +188,12 @@ public MetricAlertResource() [JsonProperty(PropertyName = "properties.lastUpdatedTime")] public System.DateTime? LastUpdatedTime { get; private set; } + /// + /// Gets the value indicating whether this alert rule is migrated. + /// + [JsonProperty(PropertyName = "properties.isMigrated")] + public bool? IsMigrated { get; private set; } + /// /// Validate the object. /// @@ -181,9 +203,9 @@ public MetricAlertResource() public override void Validate() { base.Validate(); - if (Description == null) + if (Scopes == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Description"); + throw new ValidationException(ValidationRules.CannotBeNull, "Scopes"); } if (Criteria == null) { diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResourcePatch.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResourcePatch.cs index 7aaaa76ccfd9..79942cfb0c2b 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResourcePatch.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricAlertResourcePatch.cs @@ -34,27 +34,27 @@ public MetricAlertResourcePatch() /// /// Initializes a new instance of the MetricAlertResourcePatch class. /// + /// Resource tags /// the description of the metric alert that /// will be included in the alert email. /// Alert severity {0, 1, 2, 3, 4} /// the flag that indicates whether the metric /// alert is enabled. + /// the list of resource id's that this metric + /// alert is scoped to. /// how often the metric alert is /// evaluated represented in ISO 8601 duration format. /// the period of time (in ISO 8601 duration /// format) that is used to monitor alert activity based on the /// threshold. - /// defines the specific alert criteria - /// information. - /// Resource tags - /// the list of resource id's that this metric - /// alert is scoped to. /// the resource type of the target /// resource(s) on which the alert is created/updated. Mandatory for /// MultipleResourceMultipleMetricCriteria. /// the region of the target /// resource(s) on which the alert is created/updated. Mandatory for /// MultipleResourceMultipleMetricCriteria. + /// defines the specific alert criteria + /// information. /// the flag that indicates whether the /// alert should be auto resolved or not. The default is true. /// the array of actions that are performed when @@ -62,7 +62,9 @@ public MetricAlertResourcePatch() /// resolved. /// Last time the rule was updated in /// ISO8601 format. - public MetricAlertResourcePatch(string description, int severity, bool enabled, System.TimeSpan evaluationFrequency, System.TimeSpan windowSize, MetricAlertCriteria criteria, IDictionary tags = default(IDictionary), IList scopes = default(IList), string targetResourceType = default(string), string targetResourceRegion = default(string), bool? autoMitigate = default(bool?), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?)) + /// the value indicating whether this alert + /// rule is migrated. + public MetricAlertResourcePatch(IDictionary tags = default(IDictionary), string description = default(string), int? severity = default(int?), bool? enabled = default(bool?), IList scopes = default(IList), System.TimeSpan? evaluationFrequency = default(System.TimeSpan?), System.TimeSpan? windowSize = default(System.TimeSpan?), string targetResourceType = default(string), string targetResourceRegion = default(string), MetricAlertCriteria criteria = default(MetricAlertCriteria), bool? autoMitigate = default(bool?), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?), bool? isMigrated = default(bool?)) { Tags = tags; Description = description; @@ -77,6 +79,7 @@ public MetricAlertResourcePatch() AutoMitigate = autoMitigate; Actions = actions; LastUpdatedTime = lastUpdatedTime; + IsMigrated = isMigrated; CustomInit(); } @@ -102,14 +105,14 @@ public MetricAlertResourcePatch() /// Gets or sets alert severity {0, 1, 2, 3, 4} /// [JsonProperty(PropertyName = "properties.severity")] - public int Severity { get; set; } + public int? Severity { get; set; } /// /// Gets or sets the flag that indicates whether the metric alert is /// enabled. /// [JsonProperty(PropertyName = "properties.enabled")] - public bool Enabled { get; set; } + public bool? Enabled { get; set; } /// /// Gets or sets the list of resource id's that this metric alert is @@ -123,14 +126,14 @@ public MetricAlertResourcePatch() /// ISO 8601 duration format. /// [JsonProperty(PropertyName = "properties.evaluationFrequency")] - public System.TimeSpan EvaluationFrequency { get; set; } + public System.TimeSpan? EvaluationFrequency { get; set; } /// /// Gets or sets the period of time (in ISO 8601 duration format) that /// is used to monitor alert activity based on the threshold. /// [JsonProperty(PropertyName = "properties.windowSize")] - public System.TimeSpan WindowSize { get; set; } + public System.TimeSpan? WindowSize { get; set; } /// /// Gets or sets the resource type of the target resource(s) on which @@ -175,21 +178,10 @@ public MetricAlertResourcePatch() public System.DateTime? LastUpdatedTime { get; private set; } /// - /// Validate the object. + /// Gets the value indicating whether this alert rule is migrated. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Description == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Description"); - } - if (Criteria == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Criteria"); - } - } + [JsonProperty(PropertyName = "properties.isMigrated")] + public bool? IsMigrated { get; private set; } + } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricCriteria.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricCriteria.cs index d595365129bc..399811c3f81d 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricCriteria.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricCriteria.cs @@ -35,8 +35,9 @@ public MetricCriteria() /// /// Name of the criteria. /// Name of the metric. - /// the criteria time aggregation - /// types. + /// the criteria time aggregation types. + /// Possible values include: 'Average', 'Count', 'Minimum', 'Maximum', + /// 'Total' /// the criteria operator. Possible /// values include: 'Equals', 'NotEquals', 'GreaterThan', /// 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' @@ -49,7 +50,7 @@ public MetricCriteria() /// Allows creating an alert rule on /// a custom metric that isn't yet emitted, by causing the metric /// validation to be skipped. - public MetricCriteria(string name, string metricName, object timeAggregation, string operatorProperty, double threshold, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?)) + public MetricCriteria(string name, string metricName, string timeAggregation, string operatorProperty, double threshold, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?)) : base(name, metricName, timeAggregation, additionalProperties, metricNamespace, dimensions, skipMetricValidation) { OperatorProperty = operatorProperty; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricDefinition.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricDefinition.cs index c94bb5f8bafe..fa112fa47487 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricDefinition.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricDefinition.cs @@ -39,6 +39,10 @@ public MetricDefinition() /// to. /// the name and the display name of the metric, /// i.e. it is a localizable string. + /// Detailed description of this + /// metric. + /// Custom category name for this + /// metric. /// the unit of the metric. Possible values include: /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', /// 'Percent', 'MilliSeconds', 'ByteSeconds', 'Unspecified', 'Cores', @@ -55,12 +59,14 @@ public MetricDefinition() /// definition. /// the name and the display name of the /// dimension, i.e. it is a localizable string. - public MetricDefinition(bool? isDimensionRequired = default(bool?), string resourceId = default(string), string namespaceProperty = default(string), LocalizableString name = default(LocalizableString), Unit? unit = default(Unit?), AggregationType? primaryAggregationType = default(AggregationType?), IList supportedAggregationTypes = default(IList), IList metricAvailabilities = default(IList), string id = default(string), IList dimensions = default(IList)) + public MetricDefinition(bool? isDimensionRequired = default(bool?), string resourceId = default(string), string namespaceProperty = default(string), LocalizableString name = default(LocalizableString), string displayDescription = default(string), string category = default(string), Unit? unit = default(Unit?), AggregationType? primaryAggregationType = default(AggregationType?), IList supportedAggregationTypes = default(IList), IList metricAvailabilities = default(IList), string id = default(string), IList dimensions = default(IList)) { IsDimensionRequired = isDimensionRequired; ResourceId = resourceId; NamespaceProperty = namespaceProperty; Name = name; + DisplayDescription = displayDescription; + Category = category; Unit = unit; PrimaryAggregationType = primaryAggregationType; SupportedAggregationTypes = supportedAggregationTypes; @@ -101,6 +107,18 @@ public MetricDefinition() [JsonProperty(PropertyName = "name")] public LocalizableString Name { get; set; } + /// + /// Gets or sets detailed description of this metric. + /// + [JsonProperty(PropertyName = "displayDescription")] + public string DisplayDescription { get; set; } + + /// + /// Gets or sets custom category name for this metric. + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + /// /// Gets or sets the unit of the metric. Possible values include: /// 'Count', 'Bytes', 'Seconds', 'CountPerSecond', 'BytesPerSecond', diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricNamespace.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricNamespace.cs index 6180e56c91f1..76a128fe801b 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricNamespace.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricNamespace.cs @@ -29,16 +29,19 @@ public MetricNamespace() /// /// Initializes a new instance of the MetricNamespace class. /// - /// The ID of the metricNamespace. + /// The ID of the metric namespace. /// The type of the namespace. - /// The name of the namespace. + /// The escaped name of the namespace. + /// Kind of namespace. Possible values + /// include: 'Platform', 'Custom', 'Qos' /// Properties which include the fully /// qualified namespace name. - public MetricNamespace(string id = default(string), string type = default(string), string name = default(string), MetricNamespaceName properties = default(MetricNamespaceName)) + public MetricNamespace(string id = default(string), string type = default(string), string name = default(string), NamespaceClassification? classification = default(NamespaceClassification?), MetricNamespaceName properties = default(MetricNamespaceName)) { Id = id; Type = type; Name = name; + Classification = classification; Properties = properties; CustomInit(); } @@ -49,7 +52,7 @@ public MetricNamespace() partial void CustomInit(); /// - /// Gets or sets the ID of the metricNamespace. + /// Gets or sets the ID of the metric namespace. /// [JsonProperty(PropertyName = "id")] public string Id { get; set; } @@ -61,11 +64,18 @@ public MetricNamespace() public string Type { get; set; } /// - /// Gets or sets the name of the namespace. + /// Gets or sets the escaped name of the namespace. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } + /// + /// Gets or sets kind of namespace. Possible values include: + /// 'Platform', 'Custom', 'Qos' + /// + [JsonProperty(PropertyName = "classification")] + public NamespaceClassification? Classification { get; set; } + /// /// Gets or sets properties which include the fully qualified namespace /// name. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricTrigger.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricTrigger.cs index 03738b6e53bf..7191c0df42cd 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricTrigger.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MetricTrigger.cs @@ -61,7 +61,9 @@ public MetricTrigger() /// defines what the rule monitors. /// List of dimension conditions. For example: /// [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. - public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpan timeGrain, MetricStatisticType statistic, System.TimeSpan timeWindow, TimeAggregationType timeAggregation, ComparisonOperationType operatorProperty, double threshold, string metricNamespace = default(string), IList dimensions = default(IList)) + /// a value indicating whether metric + /// should divide per instance. + public MetricTrigger(string metricName, string metricResourceUri, System.TimeSpan timeGrain, MetricStatisticType statistic, System.TimeSpan timeWindow, TimeAggregationType timeAggregation, ComparisonOperationType operatorProperty, double threshold, string metricNamespace = default(string), IList dimensions = default(IList), bool? dividePerInstance = default(bool?)) { MetricName = metricName; MetricNamespace = metricNamespace; @@ -73,6 +75,7 @@ public MetricTrigger() OperatorProperty = operatorProperty; Threshold = threshold; Dimensions = dimensions; + DividePerInstance = dividePerInstance; CustomInit(); } @@ -158,6 +161,13 @@ public MetricTrigger() [JsonProperty(PropertyName = "dimensions")] public IList Dimensions { get; set; } + /// + /// Gets or sets a value indicating whether metric should divide per + /// instance. + /// + [JsonProperty(PropertyName = "dividePerInstance")] + public bool? DividePerInstance { get; set; } + /// /// Validate the object. /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MultiMetricCriteria.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MultiMetricCriteria.cs index f83400684fce..c94de154af84 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MultiMetricCriteria.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/MultiMetricCriteria.cs @@ -34,8 +34,9 @@ public MultiMetricCriteria() /// /// Name of the criteria. /// Name of the metric. - /// the criteria time aggregation - /// types. + /// the criteria time aggregation types. + /// Possible values include: 'Average', 'Count', 'Minimum', 'Maximum', + /// 'Total' /// Unmatched properties from the /// message are deserialized this collection /// Namespace of the metric. @@ -43,7 +44,7 @@ public MultiMetricCriteria() /// Allows creating an alert rule on /// a custom metric that isn't yet emitted, by causing the metric /// validation to be skipped. - public MultiMetricCriteria(string name, string metricName, object timeAggregation, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?)) + public MultiMetricCriteria(string name, string metricName, string timeAggregation, IDictionary additionalProperties = default(IDictionary), string metricNamespace = default(string), IList dimensions = default(IList), bool? skipMetricValidation = default(bool?)) { AdditionalProperties = additionalProperties; Name = name; @@ -86,10 +87,11 @@ public MultiMetricCriteria() public string MetricNamespace { get; set; } /// - /// Gets or sets the criteria time aggregation types. + /// Gets or sets the criteria time aggregation types. Possible values + /// include: 'Average', 'Count', 'Minimum', 'Maximum', 'Total' /// [JsonProperty(PropertyName = "timeAggregation")] - public object TimeAggregation { get; set; } + public string TimeAggregation { get; set; } /// /// Gets or sets list of dimension conditions. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/NamespaceClassification.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/NamespaceClassification.cs new file mode 100644 index 000000000000..ee31229806d6 --- /dev/null +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/NamespaceClassification.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Monitor.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for NamespaceClassification. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum NamespaceClassification + { + [EnumMember(Value = "Platform")] + Platform, + [EnumMember(Value = "Custom")] + Custom, + [EnumMember(Value = "Qos")] + Qos + } + internal static class NamespaceClassificationEnumExtension + { + internal static string ToSerializedValue(this NamespaceClassification? value) + { + return value == null ? null : ((NamespaceClassification)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this NamespaceClassification value) + { + switch( value ) + { + case NamespaceClassification.Platform: + return "Platform"; + case NamespaceClassification.Custom: + return "Custom"; + case NamespaceClassification.Qos: + return "Qos"; + } + return null; + } + + internal static NamespaceClassification? ParseNamespaceClassification(this string value) + { + switch( value ) + { + case "Platform": + return NamespaceClassification.Platform; + case "Custom": + return NamespaceClassification.Custom; + case "Qos": + return NamespaceClassification.Qos; + } + return null; + } + } +} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/PerfCounterDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/PerfCounterDataSource.cs deleted file mode 100644 index 6d519443ccec..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/PerfCounterDataSource.cs +++ /dev/null @@ -1,143 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Definition of which performance counters will be collected and how they - /// will be collected by this data collection rule. - /// Collected from both Windows and Linux machines where the counter is - /// present. - /// - public partial class PerfCounterDataSource - { - /// - /// Initializes a new instance of the PerfCounterDataSource class. - /// - public PerfCounterDataSource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PerfCounterDataSource class. - /// - /// List of streams that this data source will be - /// sent to. - /// A stream indicates what schema will be used for this data and - /// usually what table in Log Analytics the data will be sent - /// to. - /// The interval between data - /// uploads (scheduled transfers), rounded up to the nearest minute. - /// Possible values include: 'PT1M', 'PT5M', 'PT15M', 'PT30M', - /// 'PT60M' - /// The number of seconds - /// between consecutive counter measurements (samples). - /// A list of specifier names of the - /// performance counters you want to collect. - /// Use a wildcard (*) to collect a counter for all instances. - /// To get a list of performance counters on Windows, run the command - /// 'typeperf'. - /// A friendly name for the data source. - /// This name should be unique across all data sources (regardless of - /// type) within the data collection rule. - public PerfCounterDataSource(IList streams, string scheduledTransferPeriod, int samplingFrequencyInSeconds, IList counterSpecifiers, string name) - { - Streams = streams; - ScheduledTransferPeriod = scheduledTransferPeriod; - SamplingFrequencyInSeconds = samplingFrequencyInSeconds; - CounterSpecifiers = counterSpecifiers; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of streams that this data source will be sent to. - /// A stream indicates what schema will be used for this data and - /// usually what table in Log Analytics the data will be sent to. - /// - [JsonProperty(PropertyName = "streams")] - public IList Streams { get; set; } - - /// - /// Gets or sets the interval between data uploads (scheduled - /// transfers), rounded up to the nearest minute. Possible values - /// include: 'PT1M', 'PT5M', 'PT15M', 'PT30M', 'PT60M' - /// - [JsonProperty(PropertyName = "scheduledTransferPeriod")] - public string ScheduledTransferPeriod { get; set; } - - /// - /// Gets or sets the number of seconds between consecutive counter - /// measurements (samples). - /// - [JsonProperty(PropertyName = "samplingFrequencyInSeconds")] - public int SamplingFrequencyInSeconds { get; set; } - - /// - /// Gets or sets a list of specifier names of the performance counters - /// you want to collect. - /// Use a wildcard (*) to collect a counter for all instances. - /// To get a list of performance counters on Windows, run the command - /// 'typeperf'. - /// - [JsonProperty(PropertyName = "counterSpecifiers")] - public IList CounterSpecifiers { get; set; } - - /// - /// Gets or sets a friendly name for the data source. - /// This name should be unique across all data sources (regardless of - /// type) within the data collection rule. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Streams == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Streams"); - } - if (ScheduledTransferPeriod == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ScheduledTransferPeriod"); - } - if (CounterSpecifiers == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "CounterSpecifiers"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (SamplingFrequencyInSeconds > 30) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "SamplingFrequencyInSeconds", 30); - } - if (SamplingFrequencyInSeconds < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "SamplingFrequencyInSeconds", 1); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Resource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Resource.cs index d3ccce82751b..c202da09e7dc 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Resource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Resource.cs @@ -38,13 +38,26 @@ public Resource() /// Azure resource name /// Azure resource type /// Resource tags - public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string kind = default(string), string etag = default(string)) { Id = id; Name = name; Type = type; Location = location; Tags = tags; + Kind = kind; + Etag = etag; CustomInit(); } @@ -83,6 +96,27 @@ public Resource() [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } + /// + /// Gets metadata used by portal/tooling/etc to render different UX + /// experiences for resources of the same type; e.g. ApiApps are a kind + /// of Microsoft.Web/sites type. If supported, the resource provider + /// must validate and persist this value. + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; private set; } + + /// + /// Gets the etag field is *not* required. If it is provided in the + /// response body, it must also be provided as a header per the normal + /// etag convention. Entity tags are used for comparing two or more + /// entities from the same requested resource. HTTP/1.1 uses entity + /// tags in the etag (section 14.19), If-Match (section 14.24), + /// If-None-Match (section 14.26), and If-Range (section 14.27) header + /// fields. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Response.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Response.cs index 93627a8a00db..da3a9774ea33 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Response.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Response.cs @@ -37,15 +37,15 @@ public Response() /// separated by '/'. This may be adjusted in the future and returned /// back from what was originally requested. /// the value of the collection. - /// The integer value representing the cost of the - /// query, for data case. + /// The integer value representing the relative cost + /// of the query. /// 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. - /// The namespace of the metrics been + /// The namespace of the metrics being /// queried - /// The region of the resource been + /// The region of the resource being /// queried for metrics. public Response(string timespan, IList value, double? cost = default(double?), System.TimeSpan? interval = default(System.TimeSpan?), string namespaceProperty = default(string), string resourceregion = default(string)) { @@ -64,8 +64,8 @@ public Response() partial void CustomInit(); /// - /// Gets or sets the integer value representing the cost of the query, - /// for data case. + /// Gets or sets the integer value representing the relative cost of + /// the query. /// [JsonProperty(PropertyName = "cost")] public double? Cost { get; set; } @@ -89,13 +89,13 @@ public Response() public System.TimeSpan? Interval { get; set; } /// - /// Gets or sets the namespace of the metrics been queried + /// Gets or sets the namespace of the metrics being queried /// [JsonProperty(PropertyName = "namespace")] public string NamespaceProperty { get; set; } /// - /// Gets or sets the region of the resource been queried for metrics. + /// Gets or sets the region of the resource being queried for metrics. /// [JsonProperty(PropertyName = "resourceregion")] public string Resourceregion { get; set; } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleDataSource.cs index 64f93af629ca..aebbde22872c 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleDataSource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleDataSource.cs @@ -32,9 +32,18 @@ public RuleDataSource() /// the resource identifier of the resource /// the rule monitors. **NOTE**: this property cannot be updated for an /// existing rule. - public RuleDataSource(string resourceUri = default(string)) + /// the legacy resource identifier of + /// the resource the rule monitors. **NOTE**: this property cannot be + /// updated for an existing rule. + /// the location of the + /// resource. + /// the namespace of the metric. + public RuleDataSource(string resourceUri = default(string), string legacyResourceId = default(string), string resourceLocation = default(string), string metricNamespace = default(string)) { ResourceUri = resourceUri; + LegacyResourceId = legacyResourceId; + ResourceLocation = resourceLocation; + MetricNamespace = metricNamespace; CustomInit(); } @@ -51,5 +60,25 @@ public RuleDataSource() [JsonProperty(PropertyName = "resourceUri")] public string ResourceUri { get; set; } + /// + /// Gets or sets the legacy resource identifier of the resource the + /// rule monitors. **NOTE**: this property cannot be updated for an + /// existing rule. + /// + [JsonProperty(PropertyName = "legacyResourceId")] + public string LegacyResourceId { get; set; } + + /// + /// Gets or sets the location of the resource. + /// + [JsonProperty(PropertyName = "resourceLocation")] + public string ResourceLocation { get; set; } + + /// + /// Gets or sets the namespace of the metric. + /// + [JsonProperty(PropertyName = "metricNamespace")] + public string MetricNamespace { get; set; } + } } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleManagementEventDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleManagementEventDataSource.cs index f63b7fb514fe..8c50bf453300 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleManagementEventDataSource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleManagementEventDataSource.cs @@ -36,6 +36,12 @@ public RuleManagementEventDataSource() /// the resource identifier of the resource /// the rule monitors. **NOTE**: this property cannot be updated for an /// existing rule. + /// the legacy resource identifier of + /// the resource the rule monitors. **NOTE**: this property cannot be + /// updated for an existing rule. + /// the location of the + /// resource. + /// the namespace of the metric. /// the event name. /// the event source. /// the level. @@ -50,8 +56,8 @@ public RuleManagementEventDataSource() /// match. /// the substatus. /// the claims. - public RuleManagementEventDataSource(string resourceUri = default(string), string eventName = default(string), string eventSource = default(string), string level = default(string), string operationName = default(string), string resourceGroupName = default(string), string resourceProviderName = default(string), string status = default(string), string subStatus = default(string), RuleManagementEventClaimsDataSource claims = default(RuleManagementEventClaimsDataSource)) - : base(resourceUri) + public RuleManagementEventDataSource(string resourceUri = default(string), string legacyResourceId = default(string), string resourceLocation = default(string), string metricNamespace = default(string), string eventName = default(string), string eventSource = default(string), string level = default(string), string operationName = default(string), string resourceGroupName = default(string), string resourceProviderName = default(string), string status = default(string), string subStatus = default(string), RuleManagementEventClaimsDataSource claims = default(RuleManagementEventClaimsDataSource)) + : base(resourceUri, legacyResourceId, resourceLocation, metricNamespace) { EventName = eventName; EventSource = eventSource; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleMetricDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleMetricDataSource.cs index d9a2e97448e7..7b650acc4bff 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleMetricDataSource.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/RuleMetricDataSource.cs @@ -34,10 +34,16 @@ public RuleMetricDataSource() /// the resource identifier of the resource /// the rule monitors. **NOTE**: this property cannot be updated for an /// existing rule. + /// the legacy resource identifier of + /// the resource the rule monitors. **NOTE**: this property cannot be + /// updated for an existing rule. + /// the location of the + /// resource. + /// the namespace of the metric. /// the name of the metric that defines what /// the rule monitors. - public RuleMetricDataSource(string resourceUri = default(string), string metricName = default(string)) - : base(resourceUri) + public RuleMetricDataSource(string resourceUri = default(string), string legacyResourceId = default(string), string resourceLocation = default(string), string metricNamespace = default(string), string metricName = default(string)) + : base(resourceUri, legacyResourceId, resourceLocation, metricNamespace) { MetricName = metricName; CustomInit(); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Sensitivity.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Sensitivity.cs deleted file mode 100644 index 44e3f73a0387..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/Sensitivity.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for Sensitivity. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum Sensitivity - { - [EnumMember(Value = "Low")] - Low, - [EnumMember(Value = "Medium")] - Medium, - [EnumMember(Value = "High")] - High - } - internal static class SensitivityEnumExtension - { - internal static string ToSerializedValue(this Sensitivity? value) - { - return value == null ? null : ((Sensitivity)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this Sensitivity value) - { - switch( value ) - { - case Sensitivity.Low: - return "Low"; - case Sensitivity.Medium: - return "Medium"; - case Sensitivity.High: - return "High"; - } - return null; - } - - internal static Sensitivity? ParseSensitivity(this string value) - { - switch( value ) - { - case "Low": - return Sensitivity.Low; - case "Medium": - return Sensitivity.Medium; - case "High": - return Sensitivity.High; - } - return null; - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/SyslogDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/SyslogDataSource.cs deleted file mode 100644 index f3106d2c8e3d..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/SyslogDataSource.cs +++ /dev/null @@ -1,107 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Definition of which syslog data will be collected and how it will be - /// collected. - /// Only collected from Linux machines. - /// - public partial class SyslogDataSource - { - /// - /// Initializes a new instance of the SyslogDataSource class. - /// - public SyslogDataSource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SyslogDataSource class. - /// - /// List of streams that this data source will be - /// sent to. - /// A stream indicates what schema will be used for this data and - /// usually what table in Log Analytics the data will be sent - /// to. - /// The list of facility names. - /// A friendly name for the data source. - /// This name should be unique across all data sources (regardless of - /// type) within the data collection rule. - /// The log levels to collect. - public SyslogDataSource(IList streams, IList facilityNames, string name, IList logLevels = default(IList)) - { - Streams = streams; - FacilityNames = facilityNames; - LogLevels = logLevels; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of streams that this data source will be sent to. - /// A stream indicates what schema will be used for this data and - /// usually what table in Log Analytics the data will be sent to. - /// - [JsonProperty(PropertyName = "streams")] - public IList Streams { get; set; } - - /// - /// Gets or sets the list of facility names. - /// - [JsonProperty(PropertyName = "facilityNames")] - public IList FacilityNames { get; set; } - - /// - /// Gets or sets the log levels to collect. - /// - [JsonProperty(PropertyName = "logLevels")] - public IList LogLevels { get; set; } - - /// - /// Gets or sets a friendly name for the data source. - /// This name should be unique across all data sources (regardless of - /// type) within the data collection rule. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Streams == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Streams"); - } - if (FacilityNames == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "FacilityNames"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesBaseline.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesBaseline.cs index 24a82423f312..931c37ed3405 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesBaseline.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesBaseline.cs @@ -40,14 +40,14 @@ public TimeSeriesBaseline() /// sensitivity. /// The dimensions of this time /// series. - /// The baseline metadata values. - public TimeSeriesBaseline(string aggregation, IList timestamps, IList data, IList dimensions = default(IList), IList metadata = default(IList)) + /// The baseline metadata values. + public TimeSeriesBaseline(string aggregation, IList timestamps, IList data, IList dimensions = default(IList), IList metadataValues = default(IList)) { Aggregation = aggregation; Dimensions = dimensions; Timestamps = timestamps; Data = data; - Metadata = metadata; + MetadataValues = metadataValues; CustomInit(); } @@ -83,8 +83,8 @@ public TimeSeriesBaseline() /// /// Gets or sets the baseline metadata values. /// - [JsonProperty(PropertyName = "metadata")] - public IList Metadata { get; set; } + [JsonProperty(PropertyName = "metadataValues")] + public IList MetadataValues { get; set; } /// /// Validate the object. @@ -126,9 +126,9 @@ public virtual void Validate() } } } - if (Metadata != null) + if (MetadataValues != null) { - foreach (var element2 in Metadata) + foreach (var element2 in MetadataValues) { if (element2 != null) { diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesInformation.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesInformation.cs deleted file mode 100644 index 4e6eb4bb17b5..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TimeSeriesInformation.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The time series info needed for calculating the baseline. - /// - public partial class TimeSeriesInformation - { - /// - /// Initializes a new instance of the TimeSeriesInformation class. - /// - public TimeSeriesInformation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TimeSeriesInformation class. - /// - /// the list of sensitivities for - /// calculating the baseline. - /// The metric values to calculate the - /// baseline. - /// the array of timestamps of the - /// baselines. - public TimeSeriesInformation(IList sensitivities, IList values, IList timestamps = default(IList)) - { - Sensitivities = sensitivities; - Values = values; - Timestamps = timestamps; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the list of sensitivities for calculating the - /// baseline. - /// - [JsonProperty(PropertyName = "sensitivities")] - public IList Sensitivities { get; set; } - - /// - /// Gets or sets the metric values to calculate the baseline. - /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - - /// - /// Gets or sets the array of timestamps of the baselines. - /// - [JsonProperty(PropertyName = "timestamps")] - public IList Timestamps { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Sensitivities == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Sensitivities"); - } - if (Values == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Values"); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TriggerCondition.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TriggerCondition.cs index c14ebe65e730..0f486d352511 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TriggerCondition.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/TriggerCondition.cs @@ -31,8 +31,9 @@ public TriggerCondition() /// Initializes a new instance of the TriggerCondition class. /// /// Evaluation operation for rule - - /// 'GreaterThan' or 'LessThan. Possible values include: 'GreaterThan', - /// 'LessThan', 'Equal' + /// 'GreaterThan' or 'LessThan. Possible values include: + /// 'GreaterThanOrEqual', 'LessThanOrEqual', 'GreaterThan', 'LessThan', + /// 'Equal' /// Result or count threshold based on which /// rule should be triggered. /// Trigger condition for metric query @@ -52,8 +53,8 @@ public TriggerCondition() /// /// Gets or sets evaluation operation for rule - 'GreaterThan' or - /// 'LessThan. Possible values include: 'GreaterThan', 'LessThan', - /// 'Equal' + /// 'LessThan. Possible values include: 'GreaterThanOrEqual', + /// 'LessThanOrEqual', 'GreaterThan', 'LessThan', 'Equal' /// [JsonProperty(PropertyName = "thresholdOperator")] public string ThresholdOperator { get; set; } diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WebhookReceiver.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WebhookReceiver.cs index 6f157dfc42af..767c0f216607 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WebhookReceiver.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WebhookReceiver.cs @@ -44,7 +44,7 @@ public WebhookReceiver() /// auth. /// Indicates the tenant id for aad /// auth. - public WebhookReceiver(string name, string serviceUri, bool useCommonAlertSchema, bool? useAadAuth = default(bool?), string objectId = default(string), string identifierUri = default(string), string tenantId = default(string)) + public WebhookReceiver(string name, string serviceUri, bool? useCommonAlertSchema = default(bool?), bool? useAadAuth = default(bool?), string objectId = default(string), string identifierUri = default(string), string tenantId = default(string)) { Name = name; ServiceUri = serviceUri; @@ -78,7 +78,7 @@ public WebhookReceiver() /// Gets or sets indicates whether to use common alert schema. /// [JsonProperty(PropertyName = "useCommonAlertSchema")] - public bool UseCommonAlertSchema { get; set; } + public bool? UseCommonAlertSchema { get; set; } /// /// Gets or sets indicates whether or not use AAD authentication. diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WindowsEventLogDataSource.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WindowsEventLogDataSource.cs deleted file mode 100644 index 61f6f218370f..000000000000 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/Models/WindowsEventLogDataSource.cs +++ /dev/null @@ -1,117 +0,0 @@ -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Monitor.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Definition of which Windows Event Log events will be collected and how - /// they will be collected. - /// Only collected from Windows machines. - /// - public partial class WindowsEventLogDataSource - { - /// - /// Initializes a new instance of the WindowsEventLogDataSource class. - /// - public WindowsEventLogDataSource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WindowsEventLogDataSource class. - /// - /// List of streams that this data source will be - /// sent to. - /// A stream indicates what schema will be used for this data and - /// usually what table in Log Analytics the data will be sent - /// to. - /// The interval between data - /// uploads (scheduled transfers), rounded up to the nearest minute. - /// Possible values include: 'PT1M', 'PT5M', 'PT15M', 'PT30M', - /// 'PT60M' - /// A list of Windows Event Log queries in - /// XPATH format. - /// A friendly name for the data source. - /// This name should be unique across all data sources (regardless of - /// type) within the data collection rule. - public WindowsEventLogDataSource(IList streams, string scheduledTransferPeriod, IList xPathQueries, string name) - { - Streams = streams; - ScheduledTransferPeriod = scheduledTransferPeriod; - XPathQueries = xPathQueries; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of streams that this data source will be sent to. - /// A stream indicates what schema will be used for this data and - /// usually what table in Log Analytics the data will be sent to. - /// - [JsonProperty(PropertyName = "streams")] - public IList Streams { get; set; } - - /// - /// Gets or sets the interval between data uploads (scheduled - /// transfers), rounded up to the nearest minute. Possible values - /// include: 'PT1M', 'PT5M', 'PT15M', 'PT30M', 'PT60M' - /// - [JsonProperty(PropertyName = "scheduledTransferPeriod")] - public string ScheduledTransferPeriod { get; set; } - - /// - /// Gets or sets a list of Windows Event Log queries in XPATH format. - /// - [JsonProperty(PropertyName = "xPathQueries")] - public IList XPathQueries { get; set; } - - /// - /// Gets or sets a friendly name for the data source. - /// This name should be unique across all data sources (regardless of - /// type) within the data collection rule. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Streams == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Streams"); - } - if (ScheduledTransferPeriod == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ScheduledTransferPeriod"); - } - if (XPathQueries == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "XPathQueries"); - } - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } - } -} diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MonitorManagementClient.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MonitorManagementClient.cs index aedbcd71c6ab..2362c0613cc8 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MonitorManagementClient.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/MonitorManagementClient.cs @@ -47,7 +47,7 @@ public partial class MonitorManagementClient : ServiceClient - /// The Azure subscription Id. + /// The ID of the target subscription. /// public string SubscriptionId { get; set; } @@ -139,11 +139,6 @@ public partial class MonitorManagementClient : ServiceClient public virtual IMetricsOperations Metrics { get; private set; } - /// - /// Gets the IMetricBaselineOperations. - /// - public virtual IMetricBaselineOperations MetricBaseline { get; private set; } - /// /// Gets the IBaselinesOperations. /// @@ -199,17 +194,6 @@ public partial class MonitorManagementClient : ServiceClient public virtual IPrivateLinkScopedResourcesOperations PrivateLinkScopedResources { get; private set; } - /// - /// Gets the IDataCollectionRules. - /// - public virtual IDataCollectionRules DataCollectionRules { get; private set; } - - /// - /// Gets the IDataCollectionRuleAssociations. - /// - public virtual IDataCollectionRuleAssociations DataCollectionRuleAssociations { get; private set; } - - /// /// Initializes a new instance of the MonitorManagementClient class. /// @@ -465,7 +449,6 @@ private void Initialize() TenantActivityLogs = new TenantActivityLogsOperations(this); MetricDefinitions = new MetricDefinitionsOperations(this); Metrics = new MetricsOperations(this); - MetricBaseline = new MetricBaselineOperations(this); Baselines = new BaselinesOperations(this); MetricAlerts = new MetricAlertsOperations(this); MetricAlertsStatus = new MetricAlertsStatusOperations(this); @@ -477,8 +460,6 @@ private void Initialize() PrivateLinkResources = new PrivateLinkResourcesOperations(this); PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); PrivateLinkScopedResources = new PrivateLinkScopedResourcesOperations(this); - DataCollectionRules = new DataCollectionRules(this); - DataCollectionRuleAssociations = new DataCollectionRuleAssociations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperations.cs index b7707970f58d..d95f51363183 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateEndpointConnectionsOperations.cs @@ -89,6 +89,13 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -341,6 +348,13 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -540,6 +554,13 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -755,6 +776,13 @@ internal PrivateEndpointConnectionsOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperations.cs index 62700162013c..e4781f7a91de 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkResourcesOperations.cs @@ -87,6 +87,13 @@ internal PrivateLinkResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -285,6 +292,13 @@ internal PrivateLinkResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperations.cs index 9fdbfc3bdff8..ced585d3c036 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopeOperationStatusOperations.cs @@ -95,6 +95,13 @@ internal PrivateLinkScopeOperationStatusOperations(MonitorManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-10-17-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperations.cs index d95c8489f5dc..6b0aff1857ed 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopedResourcesOperations.cs @@ -89,6 +89,13 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -342,6 +349,13 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -542,6 +556,13 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -772,6 +793,13 @@ internal PrivateLinkScopedResourcesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperations.cs index 31ebf39a4d7b..33d7c48668df 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/PrivateLinkScopesOperations.cs @@ -80,6 +80,13 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-10-17-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -263,6 +270,13 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2019-10-17-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -473,6 +487,13 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -673,6 +694,13 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -904,6 +932,13 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); @@ -1107,6 +1142,13 @@ internal PrivateLinkScopesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (scopeName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "scopeName"); diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperations.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperations.cs index 7f8e04788001..1df863591eb9 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperations.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/ScheduledQueryRulesOperations.cs @@ -69,7 +69,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -90,6 +90,13 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -198,11 +205,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -291,7 +298,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -320,6 +327,13 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2018-04-16"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -405,11 +419,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -483,7 +497,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -504,6 +518,13 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); @@ -608,11 +629,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -683,7 +704,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -709,6 +730,13 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2018-04-16"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -794,11 +822,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -848,7 +876,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -869,6 +897,13 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2018-04-16"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -959,11 +994,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1034,7 +1069,7 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1059,6 +1094,13 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } string apiVersion = "2018-04-16"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -1151,11 +1193,11 @@ internal ScheduledQueryRulesOperations(MonitorManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorContractException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorContract _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/SdkInfo_MonitorClient.cs b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/SdkInfo_MonitorClient.cs index 25d90d1590b2..ee67375f22c0 100644 --- a/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/SdkInfo_MonitorClient.cs +++ b/sdk/monitor/Microsoft.Azure.Management.Monitor/src/Generated/SdkInfo_MonitorClient.cs @@ -19,8 +19,8 @@ public static IEnumerable> ApiInfo_MonitorClient { return new Tuple[] { - new Tuple("Insights", "DataCollectionRules", "2019-11-01-preview"), - new Tuple("Insights", "DataCollectionRuleAssociations", "2019-11-01-preview"), + new Tuple("Insights", "AlertRules", "2016-03-01"), + new Tuple("Insights", "Baselines", "2019-03-01"), new Tuple("Insights", "MetricAlerts", "2018-03-01"), new Tuple("Insights", "MetricAlertsStatus", "2018-03-01"), new Tuple("Insights", "PrivateEndpointConnections", "2019-10-17-preview"), @@ -31,14 +31,11 @@ public static IEnumerable> ApiInfo_MonitorClient new Tuple("insights", "ActivityLogAlerts", "2017-04-01"), new Tuple("insights", "ActivityLogs", "2015-04-01"), new Tuple("insights", "AlertRuleIncidents", "2016-03-01"), - new Tuple("insights", "AlertRules", "2016-03-01"), new Tuple("insights", "AutoscaleSettings", "2015-04-01"), - new Tuple("insights", "Baselines", "2019-03-01"), new Tuple("insights", "DiagnosticSettings", "2017-05-01-preview"), new Tuple("insights", "DiagnosticSettingsCategory", "2017-05-01-preview"), new Tuple("insights", "EventCategories", "2015-04-01"), new Tuple("insights", "LogProfiles", "2016-03-01"), - new Tuple("insights", "MetricBaseline", "2017-11-01-preview"), new Tuple("insights", "MetricDefinitions", "2018-01-01"), new Tuple("insights", "MetricNamespaces", "2017-12-01-preview"), new Tuple("insights", "Metrics", "2018-01-01"), @@ -50,16 +47,5 @@ public static IEnumerable> ApiInfo_MonitorClient }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/monitor/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Repos\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "27cc07ddd294d98e05cb301e07a72378df9f87e8"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -