/// <summary> /// List the log profiles. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IEnumerable <LogProfileResourceInner> > ListAsync(this ILogProfilesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Updates an existing LogProfilesResource. To update other fields use the /// CreateOrUpdate method. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='logProfileName'> /// The name of the log profile. /// </param> /// <param name='logProfilesResource'> /// Parameters supplied to the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <LogProfileResourceInner> UpdateAsync(this ILogProfilesOperations operations, string logProfileName, LogProfileResourcePatchInner logProfilesResource, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(logProfileName, logProfilesResource, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Create or update a log profile in Azure Monitoring REST API. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='logProfileName'> /// The name of the log profile. /// </param> /// <param name='parameters'> /// Parameters supplied to the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <LogProfileResource> CreateOrUpdateAsync(this ILogProfilesOperations operations, string logProfileName, LogProfileResource parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(logProfileName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List the log profiles. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Insights.ILogProfilesOperations. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static LogProfileListResponse List(this ILogProfilesOperations operations) { return(Task.Factory.StartNew((object s) => { return ((ILogProfilesOperations)s).ListAsync(); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Deletes the log profile. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Insights.ILogProfilesOperations. /// </param> /// <param name='name'> /// Required. The name of the log profile. /// </param> /// <returns> /// Generic empty response. We only pass it to ensure json error /// handling /// </returns> public static EmptyResponse Delete(this ILogProfilesOperations operations, string name) { return(Task.Factory.StartNew((object s) => { return ((ILogProfilesOperations)s).DeleteAsync(name); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { this.AutoscaleSettings = new AutoscaleSettingsOperations(this); this.ServiceDiagnosticSettings = new ServiceDiagnosticSettingsOperations(this); this.AlertRules = new AlertRulesOperations(this); this.AlertRuleIncidents = new AlertRuleIncidentsOperations(this); this.LogProfiles = new LogProfilesOperations(this); this.BaseUri = new System.Uri("https://management.azure.com"); this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; SerializationSettings = new Newtonsoft.Json.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 Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter> { new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter> { new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter <RuleCondition>("odata.type")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter <RuleCondition>("odata.type")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter <RuleDataSource>("odata.type")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter <RuleDataSource>("odata.type")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter <RuleAction>("odata.type")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter <RuleAction>("odata.type")); CustomInitialize(); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); }
/// <summary> /// Initializes a new instance of the InsightsManagementClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public InsightsManagementClient(HttpClient httpClient) : base(httpClient) { this._agentDiagnosticSettingsOperations = new AgentDiagnosticSettingsOperations(this); this._alertOperations = new AlertOperations(this); this._automatedExportOperations = new AutomatedExportOperations(this); this._autoscaleOperations = new AutoscaleOperations(this); this._logProfilesOperations = new LogProfilesOperations(this); this._monitoringConfigurationOperations = new MonitoringConfigurationOperations(this); this._serviceDiagnosticSettingsOperations = new ServiceDiagnosticSettingsOperations(this); this._skuOperations = new SkuOperations(this); this._storageDiagnosticSettingsOperations = new StorageDiagnosticSettingsOperations(this); this._apiVersion = "2014-04-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Gets the log profile. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Insights.ILogProfilesOperations. /// </param> /// <param name='name'> /// Required. The name of the log profile. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <LogProfileGetResponse> GetAsync(this ILogProfilesOperations operations, string name) { return(operations.GetAsync(name, CancellationToken.None)); }
/// <summary> /// Deletes the log profile. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Insights.ILogProfilesOperations. /// </param> /// <param name='name'> /// Required. The name of the log profile. /// </param> /// <returns> /// Generic empty response. We only pass it to ensure json error /// handling /// </returns> public static Task <EmptyResponse> DeleteAsync(this ILogProfilesOperations operations, string name) { return(operations.DeleteAsync(name, CancellationToken.None)); }
/// <summary> /// Gets the log profile. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='logProfileName'> /// The name of the log profile. /// </param> public static LogProfileResource Get(this ILogProfilesOperations operations, string logProfileName) { return(operations.GetAsync(logProfileName).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the log profile. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='logProfileName'> /// The name of the log profile. /// </param> public static void Delete(this ILogProfilesOperations operations, string logProfileName) { operations.DeleteAsync(logProfileName).GetAwaiter().GetResult(); }
/// <summary> /// Deletes the log profile. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='logProfileName'> /// The name of the log profile. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task DeleteAsync(this ILogProfilesOperations operations, string logProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(logProfileName, null, cancellationToken).ConfigureAwait(false); }
/// <summary> /// Create or update a log profile in Azure Monitoring REST API. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='logProfileName'> /// The name of the log profile. /// </param> /// <param name='parameters'> /// Parameters supplied to the operation. /// </param> public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations operations, string logProfileName, LogProfileResource parameters) { return(operations.CreateOrUpdateAsync(logProfileName, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Create or update a log profile in Azure Monitoring REST API. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='logProfileName'> /// The name of the log profile. /// </param> /// <param name='parameters'> /// Parameters supplied to the operation. /// </param> public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations operations, string logProfileName, LogProfileResource parameters) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).CreateOrUpdateAsync(logProfileName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets the log profile. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='logProfileName'> /// The name of the log profile. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <LogProfileResource> GetAsync(this ILogProfilesOperations operations, string logProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(logProfileName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List the log profiles. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Insights.ILogProfilesOperations. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <LogProfileListResponse> ListAsync(this ILogProfilesOperations operations) { return(operations.ListAsync(CancellationToken.None)); }
/// <summary> /// Deletes the log profile. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='logProfileName'> /// The name of the log profile. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this ILogProfilesOperations operations, string logProfileName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(logProfileName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Create or update the log profile. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.Insights.ILogProfilesOperations. /// </param> /// <param name='name'> /// Required. The name of the log profile. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the operation. /// </param> /// <returns> /// Generic empty response. We only pass it to ensure json error /// handling /// </returns> public static Task <EmptyResponse> CreateOrUpdateAsync(this ILogProfilesOperations operations, string name, LogProfileCreatOrUpdateParameters parameters) { return(operations.CreateOrUpdateAsync(name, parameters, CancellationToken.None)); }
/// <summary> /// List the log profiles. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <System.Collections.Generic.IEnumerable <LogProfileResource> > ListAsync(this ILogProfilesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Updates an existing LogProfilesResource. To update other fields use the /// CreateOrUpdate method. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='logProfileName'> /// The name of the log profile. /// </param> /// <param name='logProfilesResource'> /// Parameters supplied to the operation. /// </param> public static LogProfileResource Update(this ILogProfilesOperations operations, string logProfileName, LogProfileResourcePatch logProfilesResource) { return(operations.UpdateAsync(logProfileName, logProfilesResource).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the log profile. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='logProfileName'> /// The name of the log profile. /// </param> public static void Delete(this ILogProfilesOperations operations, string logProfileName) { System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).DeleteAsync(logProfileName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// List the log profiles. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IEnumerable <LogProfileResource> List(this ILogProfilesOperations operations) { return(operations.ListAsync().GetAwaiter().GetResult()); }
/// <summary> /// List the log profiles. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static System.Collections.Generic.IEnumerable <LogProfileResource> List(this ILogProfilesOperations operations) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((ILogProfilesOperations)s).ListAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }