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

com.pulumi.azurenative.operationalinsights.SavedSearch Maven / Gradle / Ivy

There is a newer version: 2.82.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.azurenative.operationalinsights;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.operationalinsights.SavedSearchArgs;
import com.pulumi.azurenative.operationalinsights.outputs.TagResponse;
import com.pulumi.core.Alias;
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.Double;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Value object for saved search results.
 * Azure REST API version: 2020-08-01. Prior API version in Azure Native 1.x: 2020-08-01.
 * 
 * Other available API versions: 2015-03-20.
 * 
 * ## Example Usage
 * ### SavedSearchCreateOrUpdate
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.operationalinsights.SavedSearch;
 * import com.pulumi.azurenative.operationalinsights.SavedSearchArgs;
 * import com.pulumi.azurenative.operationalinsights.inputs.TagArgs;
 * 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 savedSearch = new SavedSearch("savedSearch", SavedSearchArgs.builder()
 *             .category("Saved Search Test Category")
 *             .displayName("Create or Update Saved Search Test")
 *             .functionAlias("heartbeat_func")
 *             .functionParameters("a:int=1")
 *             .query("Heartbeat | summarize Count() by Computer | take a")
 *             .resourceGroupName("TestRG")
 *             .savedSearchId("00000000-0000-0000-0000-00000000000")
 *             .tags(TagArgs.builder()
 *                 .name("Group")
 *                 .value("Computer")
 *                 .build())
 *             .version(2)
 *             .workspaceName("TestWS")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:operationalinsights:SavedSearch myresource1 /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId} * ``` * */ @ResourceType(type="azure-native:operationalinsights:SavedSearch") public class SavedSearch extends com.pulumi.resources.CustomResource { /** * The category of the saved search. This helps the user to find a saved search faster. * */ @Export(name="category", refs={String.class}, tree="[0]") private Output category; /** * @return The category of the saved search. This helps the user to find a saved search faster. * */ public Output category() { return this.category; } /** * Saved search display name. * */ @Export(name="displayName", refs={String.class}, tree="[0]") private Output displayName; /** * @return Saved search display name. * */ public Output displayName() { return this.displayName; } /** * The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag * */ @Export(name="etag", refs={String.class}, tree="[0]") private Output etag; /** * @return The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag * */ public Output> etag() { return Codegen.optional(this.etag); } /** * The function alias if query serves as a function. * */ @Export(name="functionAlias", refs={String.class}, tree="[0]") private Output functionAlias; /** * @return The function alias if query serves as a function. * */ public Output> functionAlias() { return Codegen.optional(this.functionAlias); } /** * The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. * */ @Export(name="functionParameters", refs={String.class}, tree="[0]") private Output functionParameters; /** * @return The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. * */ public Output> functionParameters() { return Codegen.optional(this.functionParameters); } /** * The name of the resource * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The name of the resource * */ public Output name() { return this.name; } /** * The query expression for the saved search. * */ @Export(name="query", refs={String.class}, tree="[0]") private Output query; /** * @return The query expression for the saved search. * */ public Output query() { return this.query; } /** * The tags attached to the saved search. * */ @Export(name="tags", refs={List.class,TagResponse.class}, tree="[0,1]") private Output> tags; /** * @return The tags attached to the saved search. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * */ public Output type() { return this.type; } /** * The version number of the query language. The current version is 2 and is the default. * */ @Export(name="version", refs={Double.class}, tree="[0]") private Output version; /** * @return The version number of the query language. The current version is 2 and is the default. * */ public Output> version() { return Codegen.optional(this.version); } /** * * @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-native:operationalinsights:SavedSearch", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private SavedSearch(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:operationalinsights:SavedSearch", name, null, 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()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:operationalinsights/v20150320:SavedSearch").build()), Output.of(Alias.builder().type("azure-native:operationalinsights/v20200301preview:SavedSearch").build()), Output.of(Alias.builder().type("azure-native:operationalinsights/v20200801:SavedSearch").build()) )) .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 options Optional settings to control the behavior of the CustomResource. */ public static SavedSearch get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new SavedSearch(name, id, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy