示例#1
0
 /// <summary>
 /// Retrieve an alert rule status.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='ruleName'>
 /// The name of the rule.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MetricAlertStatusCollection> ListAsync(this IMetricAlertsStatusOperations operations, string resourceGroupName, string ruleName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#2
0
 /// <summary>
 /// Retrieve an alert rule status.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='ruleName'>
 /// The name of the rule.
 /// </param>
 /// <param name='statusName'>
 /// The name of the status.
 /// </param>
 public static MetricAlertStatusCollection ListByName(this IMetricAlertsStatusOperations operations, string resourceGroupName, string ruleName, string statusName)
 {
     return(operations.ListByNameAsync(resourceGroupName, ruleName, statusName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     AutoscaleSettings          = new AutoscaleSettingsOperations(this);
     Operations                 = new Operations(this);
     AlertRuleIncidents         = new AlertRuleIncidentsOperations(this);
     AlertRules                 = new AlertRulesOperations(this);
     LogProfiles                = new LogProfilesOperations(this);
     DiagnosticSettings         = new DiagnosticSettingsOperations(this);
     DiagnosticSettingsCategory = new DiagnosticSettingsCategoryOperations(this);
     ActionGroups               = new ActionGroupsOperations(this);
     ActivityLogAlerts          = new ActivityLogAlertsOperations(this);
     ActivityLogs               = new ActivityLogsOperations(this);
     EventCategories            = new EventCategoriesOperations(this);
     TenantActivityLogs         = new TenantActivityLogsOperations(this);
     MetricDefinitions          = new MetricDefinitionsOperations(this);
     Metrics            = new MetricsOperations(this);
     MetricBaseline     = new MetricBaselineOperations(this);
     MetricAlerts       = new MetricAlertsOperations(this);
     MetricAlertsStatus = new MetricAlertsStatusOperations(this);
     BaseUri            = new System.Uri("https://management.azure.com");
     AcceptLanguage     = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <RuleDataSource>("odata.type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <RuleDataSource>("odata.type"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <RuleCondition>("odata.type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <RuleCondition>("odata.type"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <RuleAction>("odata.type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <RuleAction>("odata.type"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <MetricAlertCriteria>("odata.type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <MetricAlertCriteria>("odata.type"));
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }