Class Query
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.azurenative.operationalinsights.Query
-
public class Query extends com.pulumi.resources.CustomResource
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. ## Example Usage ### QueryPut ```java 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 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(Map.of("categories", "analytics")) .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} ```
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>
author()
com.pulumi.core.Output<java.lang.String>
body()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
description()
com.pulumi.core.Output<java.lang.String>
displayName()
static Query
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<java.lang.Object>
properties()
com.pulumi.core.Output<java.util.Optional<LogAnalyticsQueryPackQueryPropertiesResponseRelated>>
related()
com.pulumi.core.Output<SystemDataResponse>
systemData()
com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.util.List<java.lang.String>>>>
tags()
com.pulumi.core.Output<java.lang.String>
timeCreated()
com.pulumi.core.Output<java.lang.String>
timeModified()
com.pulumi.core.Output<java.lang.String>
type()
-
-
-
Constructor Detail
-
Query
public Query(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
Query
public Query(java.lang.String name, QueryArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
Query
public Query(java.lang.String name, QueryArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
author
public com.pulumi.core.Output<java.lang.String> author()
- Returns:
- Object Id of user creating the query.
-
body
public com.pulumi.core.Output<java.lang.String> body()
- Returns:
- Body of the query.
-
description
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> description()
- Returns:
- Description of the query.
-
displayName
public com.pulumi.core.Output<java.lang.String> displayName()
- Returns:
- Unique display name for your query within the Query Pack.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Azure resource name
-
properties
public com.pulumi.core.Output<java.lang.Object> properties()
- Returns:
- Additional properties that can be set for the query.
-
related
public com.pulumi.core.Output<java.util.Optional<LogAnalyticsQueryPackQueryPropertiesResponseRelated>> related()
- Returns:
- The related metadata items for the function.
-
systemData
public com.pulumi.core.Output<SystemDataResponse> systemData()
- Returns:
- Read only system data
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.util.List<java.lang.String>>>> tags()
- Returns:
- Tags associated with the query.
-
timeCreated
public com.pulumi.core.Output<java.lang.String> timeCreated()
- Returns:
- Creation Date for the Log Analytics Query, in ISO 8601 format.
-
timeModified
public com.pulumi.core.Output<java.lang.String> timeModified()
- Returns:
- Last modified date of the Log Analytics Query, in ISO 8601 format.
-
type
public com.pulumi.core.Output<java.lang.String> type()
- Returns:
- Azure resource type
-
get
public static Query get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.options
- Optional settings to control the behavior of the CustomResource.
-
-