Esempio n. 1
0
 /// <summary>
 /// Create or update a tag rule set for a given monitor resource.
 /// </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='monitorName'>
 /// Monitor resource name
 /// </param>
 /// <param name='ruleSetName'>
 /// Rule set name
 /// </param>
 /// <param name='properties'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MonitoringTagRules> CreateOrUpdateAsync(this ITagRulesOperations operations, string resourceGroupName, string monitorName, string ruleSetName, MonitoringTagRulesProperties properties = default(MonitoringTagRulesProperties), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, monitorName, ruleSetName, properties, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// List the tag rules for a given monitor resource.
 /// </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='monitorName'>
 /// Monitor resource name
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <MonitoringTagRules> > ListAsync(this ITagRulesOperations operations, string resourceGroupName, string monitorName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, monitorName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// List the tag rules for a given monitor resource.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <MonitoringTagRules> > ListNextAsync(this ITagRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Delete a tag rule set for a given monitor resource.
 /// </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='monitorName'>
 /// Monitor resource name
 /// </param>
 /// <param name='ruleSetName'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <TagRulesDeleteHeaders> DeleteAsync(this ITagRulesOperations operations, string resourceGroupName, string monitorName, string ruleSetName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, monitorName, ruleSetName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Headers);
     }
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations         = new Operations(this);
     Monitors           = new MonitorsOperations(this);
     MonitoredResources = new MonitoredResourcesOperations(this);
     DeploymentInfo     = new DeploymentInfoOperations(this);
     TagRules           = new TagRulesOperations(this);
     BaseUri            = new System.Uri("https://management.azure.com");
     ApiVersion         = "2020-07-01-preview";
     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()
         }
     };
     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()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Esempio n. 6
0
 /// <summary>
 /// Create or update a tag rule set for a given monitor resource.
 /// </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='monitorName'>
 /// Monitor resource name
 /// </param>
 /// <param name='ruleSetName'>
 /// Rule set name
 /// </param>
 /// <param name='properties'>
 /// </param>
 public static MonitoringTagRules CreateOrUpdate(this ITagRulesOperations operations, string resourceGroupName, string monitorName, string ruleSetName, MonitoringTagRulesProperties properties = default(MonitoringTagRulesProperties))
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, monitorName, ruleSetName, properties).GetAwaiter().GetResult());
 }
Esempio n. 7
0
 /// <summary>
 /// List the tag rules for a given monitor resource.
 /// </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='monitorName'>
 /// Monitor resource name
 /// </param>
 public static IPage <MonitoringTagRules> List(this ITagRulesOperations operations, string resourceGroupName, string monitorName)
 {
     return(operations.ListAsync(resourceGroupName, monitorName).GetAwaiter().GetResult());
 }
Esempio n. 8
0
 /// <summary>
 /// List the tag rules for a given monitor resource.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <MonitoringTagRules> ListNext(this ITagRulesOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
Esempio n. 9
0
 /// <summary>
 /// Get a tag rule set for a given monitor resource.
 /// </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='monitorName'>
 /// Monitor resource name
 /// </param>
 /// <param name='ruleSetName'>
 /// Rule set name
 /// </param>
 public static MonitoringTagRules Get(this ITagRulesOperations operations, string resourceGroupName, string monitorName, string ruleSetName)
 {
     return(operations.GetAsync(resourceGroupName, monitorName, ruleSetName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete a tag rule set for a given monitor resource.
 /// </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='monitorName'>
 /// Monitor resource name
 /// </param>
 /// <param name='ruleSetName'>
 /// </param>
 public static TagRulesDeleteHeaders Delete(this ITagRulesOperations operations, string resourceGroupName, string monitorName, string ruleSetName)
 {
     return(operations.DeleteAsync(resourceGroupName, monitorName, ruleSetName).GetAwaiter().GetResult());
 }
Esempio n. 11
0
 /// <summary>
 /// Delete a tag rule set for a given monitor resource.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group to which the Elastic resource belongs.
 /// </param>
 /// <param name='monitorName'>
 /// Monitor resource name
 /// </param>
 /// <param name='ruleSetName'>
 /// Tag Rule Set resource name
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginDeleteAsync(this ITagRulesOperations operations, string resourceGroupName, string monitorName, string ruleSetName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, monitorName, ruleSetName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Esempio n. 12
0
 /// <summary>
 /// Delete a tag rule set for a given monitor resource.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group to which the Elastic resource belongs.
 /// </param>
 /// <param name='monitorName'>
 /// Monitor resource name
 /// </param>
 /// <param name='ruleSetName'>
 /// Tag Rule Set resource name
 /// </param>
 public static void BeginDelete(this ITagRulesOperations operations, string resourceGroupName, string monitorName, string ruleSetName)
 {
     operations.BeginDeleteAsync(resourceGroupName, monitorName, ruleSetName).GetAwaiter().GetResult();
 }