/// <summary>
 /// Update log search Rule.
 /// </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='parameters'>
 /// The parameters of the rule to update.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <LogSearchRuleResourceInner> UpdateAsync(this IScheduledQueryRulesOperations operations, string resourceGroupName, string ruleName, LogSearchRuleResourcePatchInner parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, ruleName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 protected override 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);
     ScheduledQueryRules = new ScheduledQueryRulesOperations(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"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <Action>("odata.type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <Action>("odata.type"));
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
 /// <summary>
 /// List the Log Search rules within a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IEnumerable <LogSearchRuleResourceInner> > ListByResourceGroupAsync(this IScheduledQueryRulesOperations operations, string resourceGroupName, ODataQuery <LogSearchRuleResourceInner> odataQuery = default(ODataQuery <LogSearchRuleResourceInner>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #4
0
 /// <summary>
 /// Gets an Log Search rule
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='ruleName'>
 /// The name of the rule.
 /// </param>
 public static LogSearchRuleResource Get(this IScheduledQueryRulesOperations operations, string resourceGroupName, string ruleName)
 {
     return(operations.GetAsync(resourceGroupName, ruleName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes a Log Search rule
 /// </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 DeleteAsync(this IScheduledQueryRulesOperations operations, string resourceGroupName, string ruleName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
コード例 #6
0
 /// <summary>
 /// Creates or updates an log search rule.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='ruleName'>
 /// The name of the rule.
 /// </param>
 /// <param name='parameters'>
 /// The parameters of the rule to create or update.
 /// </param>
 public static LogSearchRuleResource CreateOrUpdate(this IScheduledQueryRulesOperations operations, string resourceGroupName, string ruleName, LogSearchRuleResource parameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, ruleName, parameters).GetAwaiter().GetResult());
 }
コード例 #7
0
 /// <summary>
 /// List the Log Search rules within a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 public static IEnumerable <LogSearchRuleResource> ListByResourceGroup(this IScheduledQueryRulesOperations operations, string resourceGroupName, ODataQuery <LogSearchRuleResource> odataQuery = default(ODataQuery <LogSearchRuleResource>))
 {
     return(operations.ListByResourceGroupAsync(resourceGroupName, odataQuery).GetAwaiter().GetResult());
 }
コード例 #8
0
 /// <summary>
 /// List the Log Search rules within a subscription group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IEnumerable <LogSearchRuleResource> > ListBySubscriptionAsync(this IScheduledQueryRulesOperations operations, ODataQuery <LogSearchRuleResource> odataQuery = default(ODataQuery <LogSearchRuleResource>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #9
0
 /// <summary>
 /// List the Log Search rules within a subscription group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 public static IEnumerable <LogSearchRuleResource> ListBySubscription(this IScheduledQueryRulesOperations operations, ODataQuery <LogSearchRuleResource> odataQuery = default(ODataQuery <LogSearchRuleResource>))
 {
     return(operations.ListBySubscriptionAsync(odataQuery).GetAwaiter().GetResult());
 }
コード例 #10
0
 /// <summary>
 /// Deletes a Log Search rule
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='ruleName'>
 /// The name of the rule.
 /// </param>
 public static void Delete(this IScheduledQueryRulesOperations operations, string resourceGroupName, string ruleName)
 {
     operations.DeleteAsync(resourceGroupName, ruleName).GetAwaiter().GetResult();
 }