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

com.pulumi.azurenative.insights.DataCollectionRule 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.DataCollectionRuleArgs;
import com.pulumi.azurenative.insights.outputs.DataCollectionRuleResourceResponseIdentity;
import com.pulumi.azurenative.insights.outputs.DataCollectionRuleResourceResponseSystemData;
import com.pulumi.azurenative.insights.outputs.DataCollectionRuleResponseDataSources;
import com.pulumi.azurenative.insights.outputs.DataCollectionRuleResponseDestinations;
import com.pulumi.azurenative.insights.outputs.DataCollectionRuleResponseMetadata;
import com.pulumi.azurenative.insights.outputs.DataFlowResponse;
import com.pulumi.azurenative.insights.outputs.StreamDeclarationResponse;
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.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Definition of ARM tracked top level resource.
 * Azure REST API version: 2022-06-01. Prior API version in Azure Native 1.x: 2019-11-01-preview.
 * 
 * Other available API versions: 2023-03-11.
 * 
 * ## Example Usage
 * ### Create or update data collection rule
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.insights.DataCollectionRule;
 * import com.pulumi.azurenative.insights.DataCollectionRuleArgs;
 * import com.pulumi.azurenative.insights.inputs.DataFlowArgs;
 * import com.pulumi.azurenative.insights.inputs.DataCollectionRuleDataSourcesArgs;
 * import com.pulumi.azurenative.insights.inputs.DataCollectionRuleDestinationsArgs;
 * 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 dataCollectionRule = new DataCollectionRule("dataCollectionRule", DataCollectionRuleArgs.builder()
 *             .dataCollectionRuleName("myCollectionRule")
 *             .dataFlows(DataFlowArgs.builder()
 *                 .destinations("centralWorkspace")
 *                 .streams(                
 *                     "Microsoft-Perf",
 *                     "Microsoft-Syslog",
 *                     "Microsoft-WindowsEvent")
 *                 .build())
 *             .dataSources(DataCollectionRuleDataSourcesArgs.builder()
 *                 .performanceCounters(                
 *                     PerfCounterDataSourceArgs.builder()
 *                         .counterSpecifiers(                        
 *                             "\\Processor(_Total)\\% Processor Time",
 *                             "\\Memory\\Committed Bytes",
 *                             "\\LogicalDisk(_Total)\\Free Megabytes",
 *                             "\\PhysicalDisk(_Total)\\Avg. Disk Queue Length")
 *                         .name("cloudTeamCoreCounters")
 *                         .samplingFrequencyInSeconds(15)
 *                         .streams("Microsoft-Perf")
 *                         .build(),
 *                     PerfCounterDataSourceArgs.builder()
 *                         .counterSpecifiers("\\Process(_Total)\\Thread Count")
 *                         .name("appTeamExtraCounters")
 *                         .samplingFrequencyInSeconds(30)
 *                         .streams("Microsoft-Perf")
 *                         .build())
 *                 .syslog(                
 *                     SyslogDataSourceArgs.builder()
 *                         .facilityNames("cron")
 *                         .logLevels(                        
 *                             "Debug",
 *                             "Critical",
 *                             "Emergency")
 *                         .name("cronSyslog")
 *                         .streams("Microsoft-Syslog")
 *                         .build(),
 *                     SyslogDataSourceArgs.builder()
 *                         .facilityNames("syslog")
 *                         .logLevels(                        
 *                             "Alert",
 *                             "Critical",
 *                             "Emergency")
 *                         .name("syslogBase")
 *                         .streams("Microsoft-Syslog")
 *                         .build())
 *                 .windowsEventLogs(                
 *                     WindowsEventLogDataSourceArgs.builder()
 *                         .name("cloudSecurityTeamEvents")
 *                         .streams("Microsoft-WindowsEvent")
 *                         .xPathQueries("Security!")
 *                         .build(),
 *                     WindowsEventLogDataSourceArgs.builder()
 *                         .name("appTeam1AppEvents")
 *                         .streams("Microsoft-WindowsEvent")
 *                         .xPathQueries(                        
 *                             "System![System[(Level = 1 or Level = 2 or Level = 3)]]",
 *                             "Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]")
 *                         .build())
 *                 .build())
 *             .destinations(DataCollectionRuleDestinationsArgs.builder()
 *                 .logAnalytics(LogAnalyticsDestinationArgs.builder()
 *                     .name("centralWorkspace")
 *                     .workspaceResourceId("/subscriptions/703362b3-f278-4e4b-9179-c76eaf41ffc2/resourceGroups/myResourceGroup/providers/Microsoft.OperationalInsights/workspaces/centralTeamWorkspace")
 *                     .build())
 *                 .build())
 *             .location("eastus")
 *             .resourceGroupName("myResourceGroup")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:insights:DataCollectionRule myCollectionRule /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dataCollectionRuleName} * ``` * */ @ResourceType(type="azure-native:insights:DataCollectionRule") public class DataCollectionRule extends com.pulumi.resources.CustomResource { /** * The resource ID of the data collection endpoint that this rule can be used with. * */ @Export(name="dataCollectionEndpointId", refs={String.class}, tree="[0]") private Output dataCollectionEndpointId; /** * @return The resource ID of the data collection endpoint that this rule can be used with. * */ public Output> dataCollectionEndpointId() { return Codegen.optional(this.dataCollectionEndpointId); } /** * The specification of data flows. * */ @Export(name="dataFlows", refs={List.class,DataFlowResponse.class}, tree="[0,1]") private Output> dataFlows; /** * @return The specification of data flows. * */ public Output>> dataFlows() { return Codegen.optional(this.dataFlows); } /** * The specification of data sources. * This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. * */ @Export(name="dataSources", refs={DataCollectionRuleResponseDataSources.class}, tree="[0]") private Output dataSources; /** * @return The specification of data sources. * This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. * */ public Output> dataSources() { return Codegen.optional(this.dataSources); } /** * Description of the data collection rule. * */ @Export(name="description", refs={String.class}, tree="[0]") private Output description; /** * @return Description of the data collection rule. * */ public Output> description() { return Codegen.optional(this.description); } /** * The specification of destinations. * */ @Export(name="destinations", refs={DataCollectionRuleResponseDestinations.class}, tree="[0]") private Output destinations; /** * @return The specification of destinations. * */ public Output> destinations() { return Codegen.optional(this.destinations); } /** * Resource entity tag (ETag). * */ @Export(name="etag", refs={String.class}, tree="[0]") private Output etag; /** * @return Resource entity tag (ETag). * */ public Output etag() { return this.etag; } /** * Managed service identity of the resource. * */ @Export(name="identity", refs={DataCollectionRuleResourceResponseIdentity.class}, tree="[0]") private Output identity; /** * @return Managed service identity of the resource. * */ public Output> identity() { return Codegen.optional(this.identity); } /** * The immutable ID of this data collection rule. This property is READ-ONLY. * */ @Export(name="immutableId", refs={String.class}, tree="[0]") private Output immutableId; /** * @return The immutable ID of this data collection rule. This property is READ-ONLY. * */ public Output immutableId() { return this.immutableId; } /** * The kind of the resource. * */ @Export(name="kind", refs={String.class}, tree="[0]") private Output kind; /** * @return The kind of the resource. * */ public Output> kind() { return Codegen.optional(this.kind); } /** * The geo-location where the resource lives. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return The geo-location where the resource lives. * */ public Output location() { return this.location; } /** * Metadata about the resource * */ @Export(name="metadata", refs={DataCollectionRuleResponseMetadata.class}, tree="[0]") private Output metadata; /** * @return Metadata about the resource * */ public Output metadata() { return this.metadata; } /** * The name of the resource. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The name of the resource. * */ public Output name() { return this.name; } /** * The resource provisioning state. * */ @Export(name="provisioningState", refs={String.class}, tree="[0]") private Output provisioningState; /** * @return The resource provisioning state. * */ public Output provisioningState() { return this.provisioningState; } /** * Declaration of custom streams used in this rule. * */ @Export(name="streamDeclarations", refs={Map.class,String.class,StreamDeclarationResponse.class}, tree="[0,1,2]") private Output> streamDeclarations; /** * @return Declaration of custom streams used in this rule. * */ public Output>> streamDeclarations() { return Codegen.optional(this.streamDeclarations); } /** * Metadata pertaining to creation and last modification of the resource. * */ @Export(name="systemData", refs={DataCollectionRuleResourceResponseSystemData.class}, tree="[0]") private Output systemData; /** * @return Metadata pertaining to creation and last modification of the resource. * */ public Output systemData() { return this.systemData; } /** * 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); } /** * The type of the resource. * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return The type of the resource. * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public DataCollectionRule(java.lang.String name) { this(name, DataCollectionRuleArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public DataCollectionRule(java.lang.String name, DataCollectionRuleArgs 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 DataCollectionRule(java.lang.String name, DataCollectionRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:insights:DataCollectionRule", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private DataCollectionRule(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:insights:DataCollectionRule", name, null, makeResourceOptions(options, id), false); } private static DataCollectionRuleArgs makeArgs(DataCollectionRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? DataCollectionRuleArgs.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/v20191101preview:DataCollectionRule").build()), Output.of(Alias.builder().type("azure-native:insights/v20210401:DataCollectionRule").build()), Output.of(Alias.builder().type("azure-native:insights/v20210901preview:DataCollectionRule").build()), Output.of(Alias.builder().type("azure-native:insights/v20220601:DataCollectionRule").build()), Output.of(Alias.builder().type("azure-native:insights/v20230311:DataCollectionRule").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 DataCollectionRule get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new DataCollectionRule(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy