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

com.pulumi.azurenative.insights.WorkbookTemplate Maven / Gradle / Ivy

There is a newer version: 2.78.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.insights;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.insights.WorkbookTemplateArgs;
import com.pulumi.azurenative.insights.outputs.WorkbookTemplateGalleryResponse;
import com.pulumi.azurenative.insights.outputs.WorkbookTemplateLocalizedGalleryResponse;
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.Integer;
import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * An Application Insights workbook template definition.
 * Azure REST API version: 2020-11-20. Prior API version in Azure Native 1.x: 2019-10-17-preview.
 * 
 * ## Example Usage
 * ### WorkbookTemplateAdd
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.insights.WorkbookTemplate;
 * import com.pulumi.azurenative.insights.WorkbookTemplateArgs;
 * import com.pulumi.azurenative.insights.inputs.WorkbookTemplateGalleryArgs;
 * 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 workbookTemplate = new WorkbookTemplate("workbookTemplate", WorkbookTemplateArgs.builder()
 *             .author("Contoso")
 *             .galleries(WorkbookTemplateGalleryArgs.builder()
 *                 .category("Failures")
 *                 .name("Simple Template")
 *                 .order(100)
 *                 .resourceType("microsoft.insights/components")
 *                 .type("tsg")
 *                 .build())
 *             .location("west us")
 *             .priority(1)
 *             .resourceGroupName("my-resource-group")
 *             .resourceName("testtemplate2")
 *             .templateData(Map.ofEntries(
 *                 Map.entry("$schema", "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"),
 *                 Map.entry("items",                 
 *                     Map.ofEntries(
 *                         Map.entry("content", Map.of("json", """
 * ## New workbook
 * ---
 * 
 * Welcome to your new workbook.  This area will display text formatted as markdown.
 * 
 * 
 * We've included a basic analytics query to get you started. Use the `Edit` button below each section to configure it or add more sections.                        """)),
 *                         Map.entry("name", "text - 2"),
 *                         Map.entry("type", 1)
 *                     ),
 *                     Map.ofEntries(
 *                         Map.entry("content", Map.ofEntries(
 *                             Map.entry("exportToExcelOptions", "visible"),
 *                             Map.entry("query", """
 * union withsource=TableName *
 * | summarize Count=count() by TableName
 * | render barchart                            """),
 *                             Map.entry("queryType", 0),
 *                             Map.entry("resourceType", "microsoft.operationalinsights/workspaces"),
 *                             Map.entry("size", 1),
 *                             Map.entry("version", "KqlItem/1.0")
 *                         )),
 *                         Map.entry("name", "query - 2"),
 *                         Map.entry("type", 3)
 *                     )),
 *                 Map.entry("styleSettings", ),
 *                 Map.entry("version", "Notebook/1.0")
 *             ))
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:insights:WorkbookTemplate testtemplate2 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName} * ``` * */ @ResourceType(type="azure-native:insights:WorkbookTemplate") public class WorkbookTemplate extends com.pulumi.resources.CustomResource { /** * Information about the author of the workbook template. * */ @Export(name="author", refs={String.class}, tree="[0]") private Output author; /** * @return Information about the author of the workbook template. * */ public Output> author() { return Codegen.optional(this.author); } /** * Workbook galleries supported by the template. * */ @Export(name="galleries", refs={List.class,WorkbookTemplateGalleryResponse.class}, tree="[0,1]") private Output> galleries; /** * @return Workbook galleries supported by the template. * */ public Output> galleries() { return this.galleries; } /** * Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. * */ @Export(name="localized", refs={Map.class,String.class,List.class,WorkbookTemplateLocalizedGalleryResponse.class}, tree="[0,1,[2,3]]") private Output>> localized; /** * @return Key value pair of localized gallery. Each key is the locale code of languages supported by the Azure portal. * */ public Output>>> localized() { return Codegen.optional(this.localized); } /** * Resource location * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Resource location * */ public Output location() { return this.location; } /** * Azure resource name. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Azure resource name. * */ public Output name() { return this.name; } /** * Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. * */ @Export(name="priority", refs={Integer.class}, tree="[0]") private Output priority; /** * @return Priority of the template. Determines which template to open when a workbook gallery is opened in viewer mode. * */ public Output> priority() { return Codegen.optional(this.priority); } /** * Resource tags * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Resource tags * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Valid JSON object containing workbook template payload. * */ @Export(name="templateData", refs={Object.class}, tree="[0]") private Output templateData; /** * @return Valid JSON object containing workbook template payload. * */ public Output templateData() { return this.templateData; } /** * Azure resource type * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Azure resource type * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public WorkbookTemplate(java.lang.String name) { this(name, WorkbookTemplateArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public WorkbookTemplate(java.lang.String name, WorkbookTemplateArgs 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 WorkbookTemplate(java.lang.String name, WorkbookTemplateArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:insights:WorkbookTemplate", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private WorkbookTemplate(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:insights:WorkbookTemplate", name, null, makeResourceOptions(options, id), false); } private static WorkbookTemplateArgs makeArgs(WorkbookTemplateArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? WorkbookTemplateArgs.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:insights/v20191017preview:WorkbookTemplate").build()), Output.of(Alias.builder().type("azure-native:insights/v20201120:WorkbookTemplate").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 WorkbookTemplate get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new WorkbookTemplate(name, id, options); } }