/// <summary> /// Gets the saved searches for a given Log Analytics Workspace /// </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='workspaceName'> /// The name of the workspace. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SavedSearchesListResult> ListByWorkspaceAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates or updates a saved search for a given workspace. /// </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='workspaceName'> /// The name of the workspace. /// </param> /// <param name='savedSearchId'> /// The id of the saved search. /// </param> /// <param name='parameters'> /// The parameters required to save a search. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SavedSearch> CreateOrUpdateAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the specified saved search for a given workspace. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group to get. The name is case insensitive. /// </param> /// <param name='workspaceName'> /// Log Analytics workspace name /// </param> /// <param name='savedSearchName'> /// The id of the saved search. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <SavedSearch> GetAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { this.LinkedServices = new LinkedServicesOperations(this); this.DataSources = new DataSourcesOperations(this); this.Workspaces = new WorkspacesOperations(this); this.StorageInsights = new StorageInsightsOperations(this); this.SavedSearches = new SavedSearchesOperations(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() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); }
/// <summary> /// Creates or updates a saved search for a given workspace. /// </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='workspaceName'> /// The name of the workspace. /// </param> /// <param name='savedSearchId'> /// The id of the saved search. /// </param> /// <param name='parameters'> /// The parameters required to save a search. /// </param> public static SavedSearch CreateOrUpdate(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, SavedSearch parameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, savedSearchId, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the specified saved search in a given workspace. /// </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='workspaceName'> /// The name of the workspace. /// </param> /// <param name='savedSearchId'> /// The id of the saved search. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchId, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Deletes the specified saved search in a given workspace. /// </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='workspaceName'> /// The name of the workspace. /// </param> /// <param name='savedSearchId'> /// The id of the saved search. /// </param> public static void Delete(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId) { operations.DeleteAsync(resourceGroupName, workspaceName, savedSearchId).GetAwaiter().GetResult(); }
/// <summary> /// Gets the saved searches for a given Log Analytics Workspace /// </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='workspaceName'> /// The name of the workspace. /// </param> public static SavedSearchesListResult ListByWorkspace(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName) { return(operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult()); }
/// <summary> /// Gets the specified saved search for a given workspace. /// </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='workspaceName'> /// The name of the workspace. /// </param> /// <param name='savedSearchId'> /// The id of the saved search. /// </param> public static SavedSearch Get(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchId) { return(operations.GetAsync(resourceGroupName, workspaceName, savedSearchId).GetAwaiter().GetResult()); }
/// <summary> /// Creates or updates a saved search for a given workspace. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group to get. The name is case insensitive. /// </param> /// <param name='workspaceName'> /// Log Analytics workspace name /// </param> /// <param name='savedSearchName'> /// The id of the saved search. /// </param> /// <param name='parameters'> /// The parameters required to save a search. /// </param> public static SavedSearch CreateOrUpdate(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchName, SavedSearch parameters) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((ISavedSearchesOperations)s).CreateOrUpdateAsync(resourceGroupName, workspaceName, savedSearchName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Deletes the specified saved search in a given workspace. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group to get. The name is case insensitive. /// </param> /// <param name='workspaceName'> /// Log Analytics workspace name /// </param> /// <param name='savedSearchName'> /// Name of the saved search. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task DeleteAsync(this ISavedSearchesOperations operations, string resourceGroupName, string workspaceName, string savedSearchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, savedSearchName, null, cancellationToken).ConfigureAwait(false); }