com.pulumi.azurenative.automation.Runbook 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.automation;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.automation.RunbookArgs;
import com.pulumi.azurenative.automation.outputs.ContentLinkResponse;
import com.pulumi.azurenative.automation.outputs.RunbookDraftResponse;
import com.pulumi.azurenative.automation.outputs.RunbookParameterResponse;
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.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* 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
*
*
* {@code
* 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
*
*
* {@code
* 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}
* ```
*
*/
@ResourceType(type="azure-native:automation:Runbook")
public class Runbook extends com.pulumi.resources.CustomResource {
/**
* Gets or sets the creation time.
*
*/
@Export(name="creationTime", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> creationTime;
/**
* @return Gets or sets the creation time.
*
*/
public Output> creationTime() {
return Codegen.optional(this.creationTime);
}
/**
* Gets or sets the description.
*
*/
@Export(name="description", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> description;
/**
* @return Gets or sets the description.
*
*/
public Output> description() {
return Codegen.optional(this.description);
}
/**
* Gets or sets the draft runbook properties.
*
*/
@Export(name="draft", refs={RunbookDraftResponse.class}, tree="[0]")
private Output* @Nullable */ RunbookDraftResponse> draft;
/**
* @return Gets or sets the draft runbook properties.
*
*/
public Output> draft() {
return Codegen.optional(this.draft);
}
/**
* Gets or sets the etag of the resource.
*
*/
@Export(name="etag", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> etag;
/**
* @return Gets or sets the etag of the resource.
*
*/
public Output> etag() {
return Codegen.optional(this.etag);
}
/**
* Gets or sets the job count of the runbook.
*
*/
@Export(name="jobCount", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> jobCount;
/**
* @return Gets or sets the job count of the runbook.
*
*/
public Output> jobCount() {
return Codegen.optional(this.jobCount);
}
/**
* Gets or sets the last modified by.
*
*/
@Export(name="lastModifiedBy", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> lastModifiedBy;
/**
* @return Gets or sets the last modified by.
*
*/
public Output> lastModifiedBy() {
return Codegen.optional(this.lastModifiedBy);
}
/**
* Gets or sets the last modified time.
*
*/
@Export(name="lastModifiedTime", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> lastModifiedTime;
/**
* @return Gets or sets the last modified time.
*
*/
public Output> lastModifiedTime() {
return Codegen.optional(this.lastModifiedTime);
}
/**
* The Azure Region where the resource lives
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> location;
/**
* @return The Azure Region where the resource lives
*
*/
public Output> location() {
return Codegen.optional(this.location);
}
/**
* Gets or sets the option to log activity trace of the runbook.
*
*/
@Export(name="logActivityTrace", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> logActivityTrace;
/**
* @return Gets or sets the option to log activity trace of the runbook.
*
*/
public Output> logActivityTrace() {
return Codegen.optional(this.logActivityTrace);
}
/**
* Gets or sets progress log option.
*
*/
@Export(name="logProgress", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> logProgress;
/**
* @return Gets or sets progress log option.
*
*/
public Output> logProgress() {
return Codegen.optional(this.logProgress);
}
/**
* Gets or sets verbose log option.
*
*/
@Export(name="logVerbose", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> logVerbose;
/**
* @return Gets or sets verbose log option.
*
*/
public Output> logVerbose() {
return Codegen.optional(this.logVerbose);
}
/**
* 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;
}
/**
* Gets or sets the runbook output types.
*
*/
@Export(name="outputTypes", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> outputTypes;
/**
* @return Gets or sets the runbook output types.
*
*/
public Output>> outputTypes() {
return Codegen.optional(this.outputTypes);
}
/**
* Gets or sets the runbook parameters.
*
*/
@Export(name="parameters", refs={Map.class,String.class,RunbookParameterResponse.class}, tree="[0,1,2]")
private Output* @Nullable */ Map> parameters;
/**
* @return Gets or sets the runbook parameters.
*
*/
public Output>> parameters() {
return Codegen.optional(this.parameters);
}
/**
* Gets or sets the provisioning state of the runbook.
*
*/
@Export(name="provisioningState", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> provisioningState;
/**
* @return Gets or sets the provisioning state of the runbook.
*
*/
public Output> provisioningState() {
return Codegen.optional(this.provisioningState);
}
/**
* Gets or sets the published runbook content link.
*
*/
@Export(name="publishContentLink", refs={ContentLinkResponse.class}, tree="[0]")
private Output* @Nullable */ ContentLinkResponse> publishContentLink;
/**
* @return Gets or sets the published runbook content link.
*
*/
public Output> publishContentLink() {
return Codegen.optional(this.publishContentLink);
}
/**
* Gets or sets the type of the runbook.
*
*/
@Export(name="runbookType", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> runbookType;
/**
* @return Gets or sets the type of the runbook.
*
*/
public Output> runbookType() {
return Codegen.optional(this.runbookType);
}
/**
* Gets or sets the state of the runbook.
*
*/
@Export(name="state", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> state;
/**
* @return Gets or sets the state of the runbook.
*
*/
public Output> state() {
return Codegen.optional(this.state);
}
/**
* Resource tags.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> 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 Runbook(java.lang.String name) {
this(name, RunbookArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Runbook(java.lang.String name, RunbookArgs 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 Runbook(java.lang.String name, RunbookArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:automation:Runbook", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Runbook(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:automation:Runbook", name, null, makeResourceOptions(options, id), false);
}
private static RunbookArgs makeArgs(RunbookArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? RunbookArgs.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:automation/v20151031:Runbook").build()),
Output.of(Alias.builder().type("azure-native:automation/v20180630:Runbook").build()),
Output.of(Alias.builder().type("azure-native:automation/v20190601:Runbook").build()),
Output.of(Alias.builder().type("azure-native:automation/v20220808:Runbook").build()),
Output.of(Alias.builder().type("azure-native:automation/v20230515preview:Runbook").build()),
Output.of(Alias.builder().type("azure-native:automation/v20231101:Runbook").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 Runbook get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Runbook(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy