com.pulumi.azurenative.operationalinsights.Query 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.operationalinsights;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.operationalinsights.QueryArgs;
import com.pulumi.azurenative.operationalinsights.outputs.LogAnalyticsQueryPackQueryPropertiesResponseRelated;
import com.pulumi.azurenative.operationalinsights.outputs.SystemDataResponse;
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.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* A Log Analytics QueryPack-Query definition.
* Azure REST API version: 2019-09-01. Prior API version in Azure Native 1.x: 2019-09-01.
*
* Other available API versions: 2019-09-01-preview, 2023-09-01.
*
* ## Example Usage
* ### QueryPut
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.operationalinsights.Query;
* import com.pulumi.azurenative.operationalinsights.QueryArgs;
* import com.pulumi.azurenative.operationalinsights.inputs.LogAnalyticsQueryPackQueryPropertiesRelatedArgs;
* 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 query = new Query("query", QueryArgs.builder()
* .body("""
* 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
* """)
* .description("my description")
* .displayName("Exceptions - New in the last 24 hours")
* .id("a449f8af-8e64-4b3a-9b16-5a7165ff98c4")
* .queryPackName("my-querypack")
* .related(LogAnalyticsQueryPackQueryPropertiesRelatedArgs.builder()
* .categories("analytics")
* .build())
* .resourceGroupName("my-resource-group")
* .tags(Map.ofEntries(
* Map.entry("my-label", "label1"),
* Map.entry("my-other-label", "label2")
* ))
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:operationalinsights:Query a449f8af-8e64-4b3a-9b16-5a7165ff98c4 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}
* ```
*
*/
@ResourceType(type="azure-native:operationalinsights:Query")
public class Query extends com.pulumi.resources.CustomResource {
/**
* Object Id of user creating the query.
*
*/
@Export(name="author", refs={String.class}, tree="[0]")
private Output author;
/**
* @return Object Id of user creating the query.
*
*/
public Output author() {
return this.author;
}
/**
* Body of the query.
*
*/
@Export(name="body", refs={String.class}, tree="[0]")
private Output body;
/**
* @return Body of the query.
*
*/
public Output body() {
return this.body;
}
/**
* Description of the query.
*
*/
@Export(name="description", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> description;
/**
* @return Description of the query.
*
*/
public Output> description() {
return Codegen.optional(this.description);
}
/**
* Unique display name for your query within the Query Pack.
*
*/
@Export(name="displayName", refs={String.class}, tree="[0]")
private Output displayName;
/**
* @return Unique display name for your query within the Query Pack.
*
*/
public Output displayName() {
return this.displayName;
}
/**
* Azure resource name
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return Azure resource name
*
*/
public Output name() {
return this.name;
}
/**
* Additional properties that can be set for the query.
*
*/
@Export(name="properties", refs={Object.class}, tree="[0]")
private Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy