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

com.pulumi.azure.loganalytics.kotlin.DataSourceWindowsPerformanceCounterArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.loganalytics.kotlin

import com.pulumi.azure.loganalytics.DataSourceWindowsPerformanceCounterArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages a Log Analytics (formally Operational Insights) Windows Performance Counter DataSource.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("example", {
 *     name: "example-law",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: "PerGB2018",
 * });
 * const exampleDataSourceWindowsPerformanceCounter = new azure.loganalytics.DataSourceWindowsPerformanceCounter("example", {
 *     name: "example-lad-wpc",
 *     resourceGroupName: example.name,
 *     workspaceName: exampleAnalyticsWorkspace.name,
 *     objectName: "CPU",
 *     instanceName: "*",
 *     counterName: "CPU",
 *     intervalSeconds: 10,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("example",
 *     name="example-law",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku="PerGB2018")
 * example_data_source_windows_performance_counter = azure.loganalytics.DataSourceWindowsPerformanceCounter("example",
 *     name="example-lad-wpc",
 *     resource_group_name=example.name,
 *     workspace_name=example_analytics_workspace.name,
 *     object_name="CPU",
 *     instance_name="*",
 *     counter_name="CPU",
 *     interval_seconds=10)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("example", new()
 *     {
 *         Name = "example-law",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Sku = "PerGB2018",
 *     });
 *     var exampleDataSourceWindowsPerformanceCounter = new Azure.LogAnalytics.DataSourceWindowsPerformanceCounter("example", new()
 *     {
 *         Name = "example-lad-wpc",
 *         ResourceGroupName = example.Name,
 *         WorkspaceName = exampleAnalyticsWorkspace.Name,
 *         ObjectName = "CPU",
 *         InstanceName = "*",
 *         CounterName = "CPU",
 *         IntervalSeconds = 10,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/loganalytics"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "example", &operationalinsights.AnalyticsWorkspaceArgs{
 * 			Name:              pulumi.String("example-law"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Sku:               pulumi.String("PerGB2018"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = loganalytics.NewDataSourceWindowsPerformanceCounter(ctx, "example", &loganalytics.DataSourceWindowsPerformanceCounterArgs{
 * 			Name:              pulumi.String("example-lad-wpc"),
 * 			ResourceGroupName: example.Name,
 * 			WorkspaceName:     exampleAnalyticsWorkspace.Name,
 * 			ObjectName:        pulumi.String("CPU"),
 * 			InstanceName:      pulumi.String("*"),
 * 			CounterName:       pulumi.String("CPU"),
 * 			IntervalSeconds:   pulumi.Int(10),
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.operationalinsights.AnalyticsWorkspace;
 * import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
 * import com.pulumi.azure.loganalytics.DataSourceWindowsPerformanceCounter;
 * import com.pulumi.azure.loganalytics.DataSourceWindowsPerformanceCounterArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
 *             .name("example-law")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku("PerGB2018")
 *             .build());
 *         var exampleDataSourceWindowsPerformanceCounter = new DataSourceWindowsPerformanceCounter("exampleDataSourceWindowsPerformanceCounter", DataSourceWindowsPerformanceCounterArgs.builder()
 *             .name("example-lad-wpc")
 *             .resourceGroupName(example.name())
 *             .workspaceName(exampleAnalyticsWorkspace.name())
 *             .objectName("CPU")
 *             .instanceName("*")
 *             .counterName("CPU")
 *             .intervalSeconds(10)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleAnalyticsWorkspace:
 *     type: azure:operationalinsights:AnalyticsWorkspace
 *     name: example
 *     properties:
 *       name: example-law
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       sku: PerGB2018
 *   exampleDataSourceWindowsPerformanceCounter:
 *     type: azure:loganalytics:DataSourceWindowsPerformanceCounter
 *     name: example
 *     properties:
 *       name: example-lad-wpc
 *       resourceGroupName: ${example.name}
 *       workspaceName: ${exampleAnalyticsWorkspace.name}
 *       objectName: CPU
 *       instanceName: '*'
 *       counterName: CPU
 *       intervalSeconds: 10
 * ```
 * 
 * ## Import
 * Log Analytics Windows Performance Counter DataSources can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:loganalytics/dataSourceWindowsPerformanceCounter:DataSourceWindowsPerformanceCounter example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.OperationalInsights/workspaces/workspace1/dataSources/datasource1
 * ```
 * @property counterName The friendly name of the performance counter.
 * @property instanceName The name of the virtual machine instance to which the Windows Performance Counter DataSource be applied. Specify a `*` will apply to all instances.
 * @property intervalSeconds The time of sample interval in seconds. Supports values between 10 and 2147483647.
 * @property name The Name which should be used for this Log Analytics Windows Performance Counter DataSource. Changing this forces a new Log Analytics Windows Performance Counter DataSource to be created.
 * @property objectName The object name of the Log Analytics Windows Performance Counter DataSource.
 * @property resourceGroupName The name of the Resource Group where the Log Analytics Windows Performance Counter DataSource should exist. Changing this forces a new Log Analytics Windows Performance Counter DataSource to be created.
 * @property workspaceName The name of the Log Analytics Workspace where the Log Analytics Windows Performance Counter DataSource should exist. Changing this forces a new Log Analytics Windows Performance Counter DataSource to be created.
 */
public data class DataSourceWindowsPerformanceCounterArgs(
    public val counterName: Output? = null,
    public val instanceName: Output? = null,
    public val intervalSeconds: Output? = null,
    public val name: Output? = null,
    public val objectName: Output? = null,
    public val resourceGroupName: Output? = null,
    public val workspaceName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.loganalytics.DataSourceWindowsPerformanceCounterArgs =
        com.pulumi.azure.loganalytics.DataSourceWindowsPerformanceCounterArgs.builder()
            .counterName(counterName?.applyValue({ args0 -> args0 }))
            .instanceName(instanceName?.applyValue({ args0 -> args0 }))
            .intervalSeconds(intervalSeconds?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .objectName(objectName?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .workspaceName(workspaceName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [DataSourceWindowsPerformanceCounterArgs].
 */
@PulumiTagMarker
public class DataSourceWindowsPerformanceCounterArgsBuilder internal constructor() {
    private var counterName: Output? = null

    private var instanceName: Output? = null

    private var intervalSeconds: Output? = null

    private var name: Output? = null

    private var objectName: Output? = null

    private var resourceGroupName: Output? = null

    private var workspaceName: Output? = null

    /**
     * @param value The friendly name of the performance counter.
     */
    @JvmName("dlmmlhagndilqfuy")
    public suspend fun counterName(`value`: Output) {
        this.counterName = value
    }

    /**
     * @param value The name of the virtual machine instance to which the Windows Performance Counter DataSource be applied. Specify a `*` will apply to all instances.
     */
    @JvmName("uinqbylabcgfcvch")
    public suspend fun instanceName(`value`: Output) {
        this.instanceName = value
    }

    /**
     * @param value The time of sample interval in seconds. Supports values between 10 and 2147483647.
     */
    @JvmName("psqsjjngsypcbjpo")
    public suspend fun intervalSeconds(`value`: Output) {
        this.intervalSeconds = value
    }

    /**
     * @param value The Name which should be used for this Log Analytics Windows Performance Counter DataSource. Changing this forces a new Log Analytics Windows Performance Counter DataSource to be created.
     */
    @JvmName("wiwrpqimicrtdwwo")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The object name of the Log Analytics Windows Performance Counter DataSource.
     */
    @JvmName("yvgoxqsrylanoxkn")
    public suspend fun objectName(`value`: Output) {
        this.objectName = value
    }

    /**
     * @param value The name of the Resource Group where the Log Analytics Windows Performance Counter DataSource should exist. Changing this forces a new Log Analytics Windows Performance Counter DataSource to be created.
     */
    @JvmName("pcgpqrnmjynrosma")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the Log Analytics Workspace where the Log Analytics Windows Performance Counter DataSource should exist. Changing this forces a new Log Analytics Windows Performance Counter DataSource to be created.
     */
    @JvmName("tasqbgnunbppsddk")
    public suspend fun workspaceName(`value`: Output) {
        this.workspaceName = value
    }

    /**
     * @param value The friendly name of the performance counter.
     */
    @JvmName("qwkawpbhrrkylatd")
    public suspend fun counterName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.counterName = mapped
    }

    /**
     * @param value The name of the virtual machine instance to which the Windows Performance Counter DataSource be applied. Specify a `*` will apply to all instances.
     */
    @JvmName("hrhpgyaqfnunyjym")
    public suspend fun instanceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceName = mapped
    }

    /**
     * @param value The time of sample interval in seconds. Supports values between 10 and 2147483647.
     */
    @JvmName("bsqiqsxfjallwiir")
    public suspend fun intervalSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.intervalSeconds = mapped
    }

    /**
     * @param value The Name which should be used for this Log Analytics Windows Performance Counter DataSource. Changing this forces a new Log Analytics Windows Performance Counter DataSource to be created.
     */
    @JvmName("bukjbcfupampruyr")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The object name of the Log Analytics Windows Performance Counter DataSource.
     */
    @JvmName("cvxiygpqxpaxutmt")
    public suspend fun objectName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.objectName = mapped
    }

    /**
     * @param value The name of the Resource Group where the Log Analytics Windows Performance Counter DataSource should exist. Changing this forces a new Log Analytics Windows Performance Counter DataSource to be created.
     */
    @JvmName("bolhppihefyogwnt")
    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 Log Analytics Workspace where the Log Analytics Windows Performance Counter DataSource should exist. Changing this forces a new Log Analytics Windows Performance Counter DataSource to be created.
     */
    @JvmName("logmyldpaetnmjjh")
    public suspend fun workspaceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.workspaceName = mapped
    }

    internal fun build(): DataSourceWindowsPerformanceCounterArgs =
        DataSourceWindowsPerformanceCounterArgs(
            counterName = counterName,
            instanceName = instanceName,
            intervalSeconds = intervalSeconds,
            name = name,
            objectName = objectName,
            resourceGroupName = resourceGroupName,
            workspaceName = workspaceName,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy