All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.loganalytics.SavedSearch Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.

There is a newer version: 6.15.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.loganalytics;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.loganalytics.SavedSearchArgs;
import com.pulumi.azure.loganalytics.inputs.SavedSearchState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a Log Analytics (formally Operational Insights) Saved Search.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.operationalinsights.AnalyticsWorkspace;
 * import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
 * import com.pulumi.azure.loganalytics.SavedSearch;
 * import com.pulumi.azure.loganalytics.SavedSearchArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * 
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 * 
 *     public static void stack(Context ctx) {
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 * 
 *         var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
 *             .name("acctest-01")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku("PerGB2018")
 *             .retentionInDays(30)
 *             .build());
 * 
 *         var exampleSavedSearch = new SavedSearch("exampleSavedSearch", SavedSearchArgs.builder()
 *             .name("exampleSavedSearch")
 *             .logAnalyticsWorkspaceId(exampleAnalyticsWorkspace.id())
 *             .category("exampleCategory")
 *             .displayName("exampleDisplayName")
 *             .query("exampleQuery")
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Log Analytics Saved Searches can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:loganalytics/savedSearch:SavedSearch search1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1/savedSearches/search1 * ``` * */ @ResourceType(type="azure:loganalytics/savedSearch:SavedSearch") public class SavedSearch extends com.pulumi.resources.CustomResource { /** * The category that the Saved Search will be listed under. Changing this forces a new resource to be created. * */ @Export(name="category", refs={String.class}, tree="[0]") private Output category; /** * @return The category that the Saved Search will be listed under. Changing this forces a new resource to be created. * */ public Output category() { return this.category; } /** * The name that Saved Search will be displayed as. Changing this forces a new resource to be created. * */ @Export(name="displayName", refs={String.class}, tree="[0]") private Output displayName; /** * @return The name that Saved Search will be displayed as. Changing this forces a new resource to be created. * */ public Output displayName() { return this.displayName; } /** * The function alias if the query serves as a function. Changing this forces a new resource to be created. * */ @Export(name="functionAlias", refs={String.class}, tree="[0]") private Output functionAlias; /** * @return The function alias if the query serves as a function. Changing this forces a new resource to be created. * */ public Output> functionAlias() { return Codegen.optional(this.functionAlias); } /** * The function parameters if the query serves as a function. Changing this forces a new resource to be created. For more examples and proper syntax please refer to [this document](https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/functions/user-defined-functions). * */ @Export(name="functionParameters", refs={List.class,String.class}, tree="[0,1]") private Output> functionParameters; /** * @return The function parameters if the query serves as a function. Changing this forces a new resource to be created. For more examples and proper syntax please refer to [this document](https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/functions/user-defined-functions). * */ public Output>> functionParameters() { return Codegen.optional(this.functionParameters); } /** * Specifies the ID of the Log Analytics Workspace that the Saved Search will be associated with. Changing this forces a new resource to be created. * */ @Export(name="logAnalyticsWorkspaceId", refs={String.class}, tree="[0]") private Output logAnalyticsWorkspaceId; /** * @return Specifies the ID of the Log Analytics Workspace that the Saved Search will be associated with. Changing this forces a new resource to be created. * */ public Output logAnalyticsWorkspaceId() { return this.logAnalyticsWorkspaceId; } /** * Specifies the name of the Log Analytics Saved Search. Changing this forces a new resource to be created. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Specifies the name of the Log Analytics Saved Search. Changing this forces a new resource to be created. * */ public Output name() { return this.name; } /** * The query expression for the saved search. Changing this forces a new resource to be created. * */ @Export(name="query", refs={String.class}, tree="[0]") private Output query; /** * @return The query expression for the saved search. Changing this forces a new resource to be created. * */ public Output query() { return this.query; } /** * A mapping of tags which should be assigned to the Logs Analytics Saved Search. Changing this forces a new resource to be created. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return A mapping of tags which should be assigned to the Logs Analytics Saved Search. Changing this forces a new resource to be created. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * * @param name The _unique_ name of the resulting resource. */ public SavedSearch(java.lang.String name) { this(name, SavedSearchArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public SavedSearch(java.lang.String name, SavedSearchArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public SavedSearch(java.lang.String name, SavedSearchArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:loganalytics/savedSearch:SavedSearch", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private SavedSearch(java.lang.String name, Output id, @Nullable SavedSearchState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:loganalytics/savedSearch:SavedSearch", name, state, makeResourceOptions(options, id), false); } private static SavedSearchArgs makeArgs(SavedSearchArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? SavedSearchArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state * @param options Optional settings to control the behavior of the CustomResource. */ public static SavedSearch get(java.lang.String name, Output id, @Nullable SavedSearchState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new SavedSearch(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy