Пример #1
0
 /// <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);
     VMHost             = new VMHostOperations(this);
     VMIngestion        = new VMIngestionOperations(this);
     VMCollection       = new VMCollectionOperations(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());
 }
 /// <summary>
 /// Update the vm details that will be monitored by the Elastic 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='body'>
 /// VM resource Id
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task UpdateAsync(this IVMCollectionOperations operations, string resourceGroupName, string monitorName, VMCollectionUpdate body = default(VMCollectionUpdate), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, monitorName, body, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Update the vm details that will be monitored by the Elastic 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='body'>
 /// VM resource Id
 /// </param>
 public static void Update(this IVMCollectionOperations operations, string resourceGroupName, string monitorName, VMCollectionUpdate body = default(VMCollectionUpdate))
 {
     operations.UpdateAsync(resourceGroupName, monitorName, body).GetAwaiter().GetResult();
 }