Please wait. This can take some minutes ...
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.
com.pulumi.azurenative.automation.kotlin.RunbookArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.automation.kotlin
import com.pulumi.azurenative.automation.RunbookArgs.builder
import com.pulumi.azurenative.automation.kotlin.enums.RunbookTypeEnum
import com.pulumi.azurenative.automation.kotlin.inputs.ContentLinkArgs
import com.pulumi.azurenative.automation.kotlin.inputs.ContentLinkArgsBuilder
import com.pulumi.azurenative.automation.kotlin.inputs.RunbookDraftArgs
import com.pulumi.azurenative.automation.kotlin.inputs.RunbookDraftArgsBuilder
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.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Definition of the runbook type.
* Azure REST API version: 2022-08-08. Prior API version in Azure Native 1.x: 2019-06-01.
* Other available API versions: 2023-05-15-preview, 2023-11-01.
* ## Example Usage
* ### Create or update runbook and publish it
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var runbook = new AzureNative.Automation.Runbook("runbook", new()
* {
* AutomationAccountName = "ContoseAutomationAccount",
* Description = "Description of the Runbook",
* Location = "East US 2",
* LogActivityTrace = 1,
* LogProgress = true,
* LogVerbose = false,
* Name = "Get-AzureVMTutorial",
* PublishContentLink = new AzureNative.Automation.Inputs.ContentLinkArgs
* {
* ContentHash = new AzureNative.Automation.Inputs.ContentHashArgs
* {
* Algorithm = "SHA256",
* Value = "115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80",
* },
* Uri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1",
* },
* ResourceGroupName = "rg",
* RunbookName = "Get-AzureVMTutorial",
* RunbookType = AzureNative.Automation.RunbookTypeEnum.PowerShellWorkflow,
* Tags =
* {
* { "tag01", "value01" },
* { "tag02", "value02" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* automation "github.com/pulumi/pulumi-azure-native-sdk/automation/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := automation.NewRunbook(ctx, "runbook", &automation.RunbookArgs{
* AutomationAccountName: pulumi.String("ContoseAutomationAccount"),
* Description: pulumi.String("Description of the Runbook"),
* Location: pulumi.String("East US 2"),
* LogActivityTrace: pulumi.Int(1),
* LogProgress: pulumi.Bool(true),
* LogVerbose: pulumi.Bool(false),
* Name: pulumi.String("Get-AzureVMTutorial"),
* PublishContentLink: &automation.ContentLinkArgs{
* ContentHash: &automation.ContentHashArgs{
* Algorithm: pulumi.String("SHA256"),
* Value: pulumi.String("115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80"),
* },
* Uri: pulumi.String("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1"),
* },
* ResourceGroupName: pulumi.String("rg"),
* RunbookName: pulumi.String("Get-AzureVMTutorial"),
* RunbookType: pulumi.String(automation.RunbookTypeEnumPowerShellWorkflow),
* Tags: pulumi.StringMap{
* "tag01": pulumi.String("value01"),
* "tag02": pulumi.String("value02"),
* },
* })
* 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.automation.Runbook;
* import com.pulumi.azurenative.automation.RunbookArgs;
* import com.pulumi.azurenative.automation.inputs.ContentLinkArgs;
* import com.pulumi.azurenative.automation.inputs.ContentHashArgs;
* 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 runbook = new Runbook("runbook", RunbookArgs.builder()
* .automationAccountName("ContoseAutomationAccount")
* .description("Description of the Runbook")
* .location("East US 2")
* .logActivityTrace(1)
* .logProgress(true)
* .logVerbose(false)
* .name("Get-AzureVMTutorial")
* .publishContentLink(ContentLinkArgs.builder()
* .contentHash(ContentHashArgs.builder()
* .algorithm("SHA256")
* .value("115775B8FF2BE672D8A946BD0B489918C724DDE15A440373CA54461D53010A80")
* .build())
* .uri("https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-automation-runbook-getvms/Runbooks/Get-AzureVMTutorial.ps1")
* .build())
* .resourceGroupName("rg")
* .runbookName("Get-AzureVMTutorial")
* .runbookType("PowerShellWorkflow")
* .tags(Map.ofEntries(
* Map.entry("tag01", "value01"),
* Map.entry("tag02", "value02")
* ))
* .build());
* }
* }
* ```
* ### Create runbook as draft
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var runbook = new AzureNative.Automation.Runbook("runbook", new()
* {
* AutomationAccountName = "ContoseAutomationAccount",
* Description = "Description of the Runbook",
* Draft = null,
* Location = "East US 2",
* LogProgress = false,
* LogVerbose = false,
* Name = "Get-AzureVMTutorial",
* ResourceGroupName = "rg",
* RunbookName = "Get-AzureVMTutorial",
* RunbookType = AzureNative.Automation.RunbookTypeEnum.PowerShellWorkflow,
* Tags =
* {
* { "tag01", "value01" },
* { "tag02", "value02" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* automation "github.com/pulumi/pulumi-azure-native-sdk/automation/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := automation.NewRunbook(ctx, "runbook", &automation.RunbookArgs{
* AutomationAccountName: pulumi.String("ContoseAutomationAccount"),
* Description: pulumi.String("Description of the Runbook"),
* Draft: nil,
* Location: pulumi.String("East US 2"),
* LogProgress: pulumi.Bool(false),
* LogVerbose: pulumi.Bool(false),
* Name: pulumi.String("Get-AzureVMTutorial"),
* ResourceGroupName: pulumi.String("rg"),
* RunbookName: pulumi.String("Get-AzureVMTutorial"),
* RunbookType: pulumi.String(automation.RunbookTypeEnumPowerShellWorkflow),
* Tags: pulumi.StringMap{
* "tag01": pulumi.String("value01"),
* "tag02": pulumi.String("value02"),
* },
* })
* 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.automation.Runbook;
* import com.pulumi.azurenative.automation.RunbookArgs;
* import com.pulumi.azurenative.automation.inputs.RunbookDraftArgs;
* 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 runbook = new Runbook("runbook", RunbookArgs.builder()
* .automationAccountName("ContoseAutomationAccount")
* .description("Description of the Runbook")
* .draft()
* .location("East US 2")
* .logProgress(false)
* .logVerbose(false)
* .name("Get-AzureVMTutorial")
* .resourceGroupName("rg")
* .runbookName("Get-AzureVMTutorial")
* .runbookType("PowerShellWorkflow")
* .tags(Map.ofEntries(
* Map.entry("tag01", "value01"),
* Map.entry("tag02", "value02")
* ))
* .build());
* }
* }
* ```
* ## Import
* An existing resource can be imported using its type token, name, and identifier, e.g.
* ```sh
* $ pulumi import azure-native:automation:Runbook Get-AzureVMTutorial /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}
* ```
* @property automationAccountName The name of the automation account.
* @property description Gets or sets the description of the runbook.
* @property draft Gets or sets the draft runbook properties.
* @property location Gets or sets the location of the resource.
* @property logActivityTrace Gets or sets the activity-level tracing options of the runbook.
* @property logProgress Gets or sets progress log option.
* @property logVerbose Gets or sets verbose log option.
* @property name Gets or sets the name of the resource.
* @property publishContentLink Gets or sets the published runbook content link.
* @property resourceGroupName Name of an Azure Resource group.
* @property runbookName The runbook name.
* @property runbookType Gets or sets the type of the runbook.
* @property tags Gets or sets the tags attached to the resource.
*/
public data class RunbookArgs(
public val automationAccountName: Output? = null,
public val description: Output? = null,
public val draft: Output? = null,
public val location: Output? = null,
public val logActivityTrace: Output? = null,
public val logProgress: Output? = null,
public val logVerbose: Output? = null,
public val name: Output? = null,
public val publishContentLink: Output? = null,
public val resourceGroupName: Output? = null,
public val runbookName: Output? = null,
public val runbookType: Output>? = null,
public val tags: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.automation.RunbookArgs =
com.pulumi.azurenative.automation.RunbookArgs.builder()
.automationAccountName(automationAccountName?.applyValue({ args0 -> args0 }))
.description(description?.applyValue({ args0 -> args0 }))
.draft(draft?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.location(location?.applyValue({ args0 -> args0 }))
.logActivityTrace(logActivityTrace?.applyValue({ args0 -> args0 }))
.logProgress(logProgress?.applyValue({ args0 -> args0 }))
.logVerbose(logVerbose?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.publishContentLink(
publishContentLink?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.runbookName(runbookName?.applyValue({ args0 -> args0 }))
.runbookType(
runbookType?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.tags(
tags?.applyValue({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
}),
).build()
}
/**
* Builder for [RunbookArgs].
*/
@PulumiTagMarker
public class RunbookArgsBuilder internal constructor() {
private var automationAccountName: Output? = null
private var description: Output? = null
private var draft: Output? = null
private var location: Output? = null
private var logActivityTrace: Output? = null
private var logProgress: Output? = null
private var logVerbose: Output? = null
private var name: Output? = null
private var publishContentLink: Output? = null
private var resourceGroupName: Output? = null
private var runbookName: Output? = null
private var runbookType: Output>? = null
private var tags: Output>? = null
/**
* @param value The name of the automation account.
*/
@JvmName("svgxdednkohcgjdf")
public suspend fun automationAccountName(`value`: Output) {
this.automationAccountName = value
}
/**
* @param value Gets or sets the description of the runbook.
*/
@JvmName("bjwbmxlfmkufmfvg")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value Gets or sets the draft runbook properties.
*/
@JvmName("irmntlotghwvsgjl")
public suspend fun draft(`value`: Output) {
this.draft = value
}
/**
* @param value Gets or sets the location of the resource.
*/
@JvmName("vqwaknvxugrfabdn")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value Gets or sets the activity-level tracing options of the runbook.
*/
@JvmName("rwnixdvtyrdqypaa")
public suspend fun logActivityTrace(`value`: Output) {
this.logActivityTrace = value
}
/**
* @param value Gets or sets progress log option.
*/
@JvmName("pioydwefttbftqhi")
public suspend fun logProgress(`value`: Output) {
this.logProgress = value
}
/**
* @param value Gets or sets verbose log option.
*/
@JvmName("emhgirgqyvgmqucu")
public suspend fun logVerbose(`value`: Output) {
this.logVerbose = value
}
/**
* @param value Gets or sets the name of the resource.
*/
@JvmName("dlwkisijbaajdgbd")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value Gets or sets the published runbook content link.
*/
@JvmName("ldtspkatokbbqnvd")
public suspend fun publishContentLink(`value`: Output) {
this.publishContentLink = value
}
/**
* @param value Name of an Azure Resource group.
*/
@JvmName("lwwmyfbdhkarghen")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value The runbook name.
*/
@JvmName("rechlrdgkyagffjm")
public suspend fun runbookName(`value`: Output) {
this.runbookName = value
}
/**
* @param value Gets or sets the type of the runbook.
*/
@JvmName("acegugvcdtsncxnu")
public suspend fun runbookType(`value`: Output>) {
this.runbookType = value
}
/**
* @param value Gets or sets the tags attached to the resource.
*/
@JvmName("yeumaissltilxnqx")
public suspend fun tags(`value`: Output>) {
this.tags = value
}
/**
* @param value The name of the automation account.
*/
@JvmName("vetynprrxekrnqvj")
public suspend fun automationAccountName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.automationAccountName = mapped
}
/**
* @param value Gets or sets the description of the runbook.
*/
@JvmName("mtdgtwgstcjjbowv")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value Gets or sets the draft runbook properties.
*/
@JvmName("wcuihpnnrgbvkbrx")
public suspend fun draft(`value`: RunbookDraftArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.draft = mapped
}
/**
* @param argument Gets or sets the draft runbook properties.
*/
@JvmName("yolohtwrvysvcwqu")
public suspend fun draft(argument: suspend RunbookDraftArgsBuilder.() -> Unit) {
val toBeMapped = RunbookDraftArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.draft = mapped
}
/**
* @param value Gets or sets the location of the resource.
*/
@JvmName("xxbjwycwwokhpsca")
public suspend fun location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.location = mapped
}
/**
* @param value Gets or sets the activity-level tracing options of the runbook.
*/
@JvmName("fcfsudyffynoayer")
public suspend fun logActivityTrace(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.logActivityTrace = mapped
}
/**
* @param value Gets or sets progress log option.
*/
@JvmName("ujqcrgxjmuxtqkcv")
public suspend fun logProgress(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.logProgress = mapped
}
/**
* @param value Gets or sets verbose log option.
*/
@JvmName("rugacyhhigsycdvc")
public suspend fun logVerbose(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.logVerbose = mapped
}
/**
* @param value Gets or sets the name of the resource.
*/
@JvmName("jbrkvfhatfxvdieu")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value Gets or sets the published runbook content link.
*/
@JvmName("ospbovuxiqrdhvej")
public suspend fun publishContentLink(`value`: ContentLinkArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.publishContentLink = mapped
}
/**
* @param argument Gets or sets the published runbook content link.
*/
@JvmName("fqwwgauovqglpkkk")
public suspend fun publishContentLink(argument: suspend ContentLinkArgsBuilder.() -> Unit) {
val toBeMapped = ContentLinkArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.publishContentLink = mapped
}
/**
* @param value Name of an Azure Resource group.
*/
@JvmName("tajuimtapmphwcck")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
/**
* @param value The runbook name.
*/
@JvmName("arxagefglrtdeuwx")
public suspend fun runbookName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.runbookName = mapped
}
/**
* @param value Gets or sets the type of the runbook.
*/
@JvmName("wfrwlabsdcisnsph")
public suspend fun runbookType(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.runbookType = mapped
}
/**
* @param value Gets or sets the type of the runbook.
*/
@JvmName("qayegvjhgflbwpro")
public fun runbookType(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.runbookType = mapped
}
/**
* @param value Gets or sets the type of the runbook.
*/
@JvmName("mnnolwkmefpohpnf")
public fun runbookType(`value`: RunbookTypeEnum) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.runbookType = mapped
}
/**
* @param value Gets or sets the tags attached to the resource.
*/
@JvmName("fgudoeiphiuaqkcj")
public suspend fun tags(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.tags = mapped
}
/**
* @param values Gets or sets the tags attached to the resource.
*/
@JvmName("nkkjpfmrumombler")
public fun tags(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.tags = mapped
}
internal fun build(): RunbookArgs = RunbookArgs(
automationAccountName = automationAccountName,
description = description,
draft = draft,
location = location,
logActivityTrace = logActivityTrace,
logProgress = logProgress,
logVerbose = logVerbose,
name = name,
publishContentLink = publishContentLink,
resourceGroupName = resourceGroupName,
runbookName = runbookName,
runbookType = runbookType,
tags = tags,
)
}