Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.insights.kotlin
import com.pulumi.azurenative.insights.AnalyticsItemArgs.builder
import com.pulumi.azurenative.insights.kotlin.enums.ItemScope
import com.pulumi.azurenative.insights.kotlin.enums.ItemType
import com.pulumi.azurenative.insights.kotlin.inputs.ApplicationInsightsComponentAnalyticsItemPropertiesArgs
import com.pulumi.azurenative.insights.kotlin.inputs.ApplicationInsightsComponentAnalyticsItemPropertiesArgsBuilder
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* 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
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var analyticsItem = new AzureNative.Insights.AnalyticsItem("analyticsItem", new()
* {
* 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 = AzureNative.Insights.ItemScope.Shared,
* ScopePath = "analyticsItems",
* Type = AzureNative.Insights.ItemType.Query,
* });
* });
* ```
* ```go
* package main
* import (
* insights "github.com/pulumi/pulumi-azure-native-sdk/insights/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := insights.NewAnalyticsItem(ctx, "analyticsItem", &insights.AnalyticsItemArgs{
* Content: pulumi.String(`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: pulumi.String("Exceptions - New in the last 24 hours"),
* ResourceGroupName: pulumi.String("my-resource-group"),
* ResourceName: pulumi.String("my-component"),
* Scope: pulumi.String(insights.ItemScopeShared),
* ScopePath: pulumi.String("analyticsItems"),
* Type: pulumi.String(insights.ItemTypeQuery),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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
* ```
* @property content The content of this item
* @property id Internally assigned unique id of the item definition.
* @property name The user-defined name of the item.
* @property overrideItem Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
* @property properties A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
* @property resourceGroupName The name of the resource group. The name is case insensitive.
* @property resourceName The name of the Application Insights component resource.
* @property scope 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.
* @property scopePath 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.
* @property type Enum indicating the type of the Analytics item.
*/
public data class AnalyticsItemArgs(
public val content: Output? = null,
public val id: Output? = null,
public val name: Output? = null,
public val overrideItem: Output? = null,
public val properties: Output? = null,
public val resourceGroupName: Output? = null,
public val resourceName: Output? = null,
public val scope: Output>? = null,
public val scopePath: Output? = null,
public val type: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.insights.AnalyticsItemArgs =
com.pulumi.azurenative.insights.AnalyticsItemArgs.builder()
.content(content?.applyValue({ args0 -> args0 }))
.id(id?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.overrideItem(overrideItem?.applyValue({ args0 -> args0 }))
.properties(properties?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.resourceName(resourceName?.applyValue({ args0 -> args0 }))
.scope(
scope?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.scopePath(scopePath?.applyValue({ args0 -> args0 }))
.type(
type?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
).build()
}
/**
* Builder for [AnalyticsItemArgs].
*/
@PulumiTagMarker
public class AnalyticsItemArgsBuilder internal constructor() {
private var content: Output? = null
private var id: Output? = null
private var name: Output? = null
private var overrideItem: Output? = null
private var properties: Output? = null
private var resourceGroupName: Output? = null
private var resourceName: Output? = null
private var scope: Output>? = null
private var scopePath: Output? = null
private var type: Output>? = null
/**
* @param value The content of this item
*/
@JvmName("gyuycaftjcuvipfm")
public suspend fun content(`value`: Output) {
this.content = value
}
/**
* @param value Internally assigned unique id of the item definition.
*/
@JvmName("penmralnslgpjwhk")
public suspend fun id(`value`: Output) {
this.id = value
}
/**
* @param value The user-defined name of the item.
*/
@JvmName("yvkorvuouxfujuda")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
*/
@JvmName("tnuennfbfksjkusx")
public suspend fun overrideItem(`value`: Output) {
this.overrideItem = value
}
/**
* @param value A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
*/
@JvmName("wkubvniqyikrwecf")
public suspend fun properties(`value`: Output) {
this.properties = value
}
/**
* @param value The name of the resource group. The name is case insensitive.
*/
@JvmName("qdlyyevhwrcggjfw")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value The name of the Application Insights component resource.
*/
@JvmName("wgycspcrjawsjtgg")
public suspend fun resourceName(`value`: Output) {
this.resourceName = value
}
/**
* @param value 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.
*/
@JvmName("wkiymojgbhleovbk")
public suspend fun scope(`value`: Output>) {
this.scope = value
}
/**
* @param value 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.
*/
@JvmName("hwupyrtmudhhvhxi")
public suspend fun scopePath(`value`: Output) {
this.scopePath = value
}
/**
* @param value Enum indicating the type of the Analytics item.
*/
@JvmName("frttosikeokrgvqk")
public suspend fun type(`value`: Output>) {
this.type = value
}
/**
* @param value The content of this item
*/
@JvmName("usghrvsuaqnxtndd")
public suspend fun content(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.content = mapped
}
/**
* @param value Internally assigned unique id of the item definition.
*/
@JvmName("bigabtkllkdoemnu")
public suspend fun id(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.id = mapped
}
/**
* @param value The user-defined name of the item.
*/
@JvmName("mupvldtuvanrquro")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value Flag indicating whether or not to force save an item. This allows overriding an item if it already exists.
*/
@JvmName("pwcnbkuyheydslkq")
public suspend fun overrideItem(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.overrideItem = mapped
}
/**
* @param value A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
*/
@JvmName("btmtiychpvlergxb")
public suspend fun properties(`value`: ApplicationInsightsComponentAnalyticsItemPropertiesArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.properties = mapped
}
/**
* @param argument A set of properties that can be defined in the context of a specific item type. Each type may have its own properties.
*/
@JvmName("trsswuaewtvsrkdq")
public suspend fun properties(argument: suspend ApplicationInsightsComponentAnalyticsItemPropertiesArgsBuilder.() -> Unit) {
val toBeMapped = ApplicationInsightsComponentAnalyticsItemPropertiesArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.properties = mapped
}
/**
* @param value The name of the resource group. The name is case insensitive.
*/
@JvmName("qengllueejtxoble")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
/**
* @param value The name of the Application Insights component resource.
*/
@JvmName("bwgctxewthnsugjq")
public suspend fun resourceName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceName = mapped
}
/**
* @param value 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.
*/
@JvmName("jvbgdhiiwviobntj")
public suspend fun scope(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.scope = mapped
}
/**
* @param value 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.
*/
@JvmName("xngujbebonvoxdbj")
public fun scope(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.scope = mapped
}
/**
* @param value 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.
*/
@JvmName("bbenqjspbhkgfnup")
public fun scope(`value`: ItemScope) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.scope = mapped
}
/**
* @param value 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.
*/
@JvmName("myjxqprqqcbheopu")
public suspend fun scopePath(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.scopePath = mapped
}
/**
* @param value Enum indicating the type of the Analytics item.
*/
@JvmName("nuviblrefqeskfnt")
public suspend fun type(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.type = mapped
}
/**
* @param value Enum indicating the type of the Analytics item.
*/
@JvmName("xwlcqhdbxywersqi")
public fun type(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.type = mapped
}
/**
* @param value Enum indicating the type of the Analytics item.
*/
@JvmName("wnhinjrfygtdqquy")
public fun type(`value`: ItemType) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.type = mapped
}
internal fun build(): AnalyticsItemArgs = AnalyticsItemArgs(
content = content,
id = id,
name = name,
overrideItem = overrideItem,
properties = properties,
resourceGroupName = resourceGroupName,
resourceName = resourceName,
scope = scope,
scopePath = scopePath,
type = type,
)
}