com.pulumi.azurenative.insights.AnalyticsItem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** 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.AnalyticsItemArgs;
import com.pulumi.azurenative.insights.outputs.ApplicationInsightsComponentAnalyticsItemPropertiesResponse;
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.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Properties that define an Analytics item that is associated to an Application Insights component.
* Azure REST API version: 2015-05-01. Prior API version in Azure Native 1.x: 2015-05-01.
*
* ## Example Usage
* ### AnalyticsItemPut
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.insights.AnalyticsItem;
* import com.pulumi.azurenative.insights.AnalyticsItemArgs;
* 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 analyticsItem = new AnalyticsItem("analyticsItem", AnalyticsItemArgs.builder()
* .content("""
* let newExceptionsTimeRange = 1d;
* let timeRangeToCheckBefore = 7d;
* exceptions
* | where timestamp < ago(timeRangeToCheckBefore)
* | summarize count() by problemId
* | join kind= rightanti (
* exceptions
* | where timestamp >= ago(newExceptionsTimeRange)
* | extend stack = tostring(details[0].rawStack)
* | summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId
* ) on problemId
* | order by count_ desc
* """)
* .name("Exceptions - New in the last 24 hours")
* .resourceGroupName("my-resource-group")
* .resourceName("my-component")
* .scope("shared")
* .scopePath("analyticsItems")
* .type("query")
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:insights:AnalyticsItem myresource1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item
* ```
*
*/
@ResourceType(type="azure-native:insights:AnalyticsItem")
public class AnalyticsItem extends com.pulumi.resources.CustomResource {
/**
* The content of this item
*
*/
@Export(name="content", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> content;
/**
* @return The content of this item
*
*/
public Output> content() {
return Codegen.optional(this.content);
}
/**
* The user-defined name of the item.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> name;
/**
* @return The user-defined name of the item.
*
*/
public Output> name() {
return Codegen.optional(this.name);
}
/**
* A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
*
*/
@Export(name="properties", refs={ApplicationInsightsComponentAnalyticsItemPropertiesResponse.class}, tree="[0]")
private Output properties;
/**
* @return A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
*
*/
public Output properties() {
return this.properties;
}
/**
* Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component.
*
*/
@Export(name="scope", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> scope;
/**
* @return Enum indicating if this item definition is owned by a specific user or is shared between all users with access to the Application Insights component.
*
*/
public Output> scope() {
return Codegen.optional(this.scope);
}
/**
* Date and time in UTC when this item was created.
*
*/
@Export(name="timeCreated", refs={String.class}, tree="[0]")
private Output timeCreated;
/**
* @return Date and time in UTC when this item was created.
*
*/
public Output timeCreated() {
return this.timeCreated;
}
/**
* Date and time in UTC of the last modification that was made to this item.
*
*/
@Export(name="timeModified", refs={String.class}, tree="[0]")
private Output timeModified;
/**
* @return Date and time in UTC of the last modification that was made to this item.
*
*/
public Output timeModified() {
return this.timeModified;
}
/**
* Enum indicating the type of the Analytics item.
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> type;
/**
* @return Enum indicating the type of the Analytics item.
*
*/
public Output> type() {
return Codegen.optional(this.type);
}
/**
* This instance's version of the data model. This can change as new features are added.
*
*/
@Export(name="version", refs={String.class}, tree="[0]")
private Output version;
/**
* @return This instance's version of the data model. This can change as new features are added.
*
*/
public Output version() {
return this.version;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public AnalyticsItem(java.lang.String name) {
this(name, AnalyticsItemArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public AnalyticsItem(java.lang.String name, AnalyticsItemArgs 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 AnalyticsItem(java.lang.String name, AnalyticsItemArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:insights:AnalyticsItem", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private AnalyticsItem(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:insights:AnalyticsItem", name, null, makeResourceOptions(options, id), false);
}
private static AnalyticsItemArgs makeArgs(AnalyticsItemArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? AnalyticsItemArgs.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/v20150501:AnalyticsItem").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 AnalyticsItem get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new AnalyticsItem(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy