com.pulumi.azure.batch.Job Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** 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.azure.batch;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.batch.JobArgs;
import com.pulumi.azure.batch.inputs.JobState;
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.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages a Batch Job.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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.batch.Account;
* import com.pulumi.azure.batch.AccountArgs;
* import com.pulumi.azure.batch.Pool;
* import com.pulumi.azure.batch.PoolArgs;
* import com.pulumi.azure.batch.inputs.PoolFixedScaleArgs;
* import com.pulumi.azure.batch.inputs.PoolStorageImageReferenceArgs;
* import com.pulumi.azure.batch.Job;
* import com.pulumi.azure.batch.JobArgs;
* 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-rg")
* .location("west europe")
* .build());
*
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("exampleaccount")
* .resourceGroupName(example.name())
* .location(example.location())
* .build());
*
* var examplePool = new Pool("examplePool", PoolArgs.builder()
* .name("examplepool")
* .resourceGroupName(example.name())
* .accountName(exampleAccount.name())
* .nodeAgentSkuId("batch.node.ubuntu 16.04")
* .vmSize("Standard_A1")
* .fixedScale(PoolFixedScaleArgs.builder()
* .targetDedicatedNodes(1)
* .build())
* .storageImageReference(PoolStorageImageReferenceArgs.builder()
* .publisher("Canonical")
* .offer("0001-com-ubuntu-server-jammy")
* .sku("22_04-lts")
* .version("latest")
* .build())
* .build());
*
* var exampleJob = new Job("exampleJob", JobArgs.builder()
* .name("examplejob")
* .batchPoolId(examplePool.id())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Batch Jobs can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:batch/job:Job example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Batch/batchAccounts/account1/pools/pool1/jobs/job1
* ```
*
*/
@ResourceType(type="azure:batch/job:Job")
public class Job extends com.pulumi.resources.CustomResource {
/**
* The ID of the Batch Pool. Changing this forces a new Batch Job to be created.
*
*/
@Export(name="batchPoolId", refs={String.class}, tree="[0]")
private Output batchPoolId;
/**
* @return The ID of the Batch Pool. Changing this forces a new Batch Job to be created.
*
*/
public Output batchPoolId() {
return this.batchPoolId;
}
/**
* Specifies a map of common environment settings applied to this Batch Job. Changing this forces a new Batch Job to be created.
*
*/
@Export(name="commonEnvironmentProperties", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> commonEnvironmentProperties;
/**
* @return Specifies a map of common environment settings applied to this Batch Job. Changing this forces a new Batch Job to be created.
*
*/
public Output>> commonEnvironmentProperties() {
return Codegen.optional(this.commonEnvironmentProperties);
}
/**
* The display name of this Batch Job. Changing this forces a new Batch Job to be created.
*
*/
@Export(name="displayName", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> displayName;
/**
* @return The display name of this Batch Job. Changing this forces a new Batch Job to be created.
*
*/
public Output> displayName() {
return Codegen.optional(this.displayName);
}
/**
* The name which should be used for this Batch Job. Changing this forces a new Batch Job to be created.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name which should be used for this Batch Job. Changing this forces a new Batch Job to be created.
*
*/
public Output name() {
return this.name;
}
/**
* The priority of this Batch Job, possible values can range from -1000 (lowest) to 1000 (highest). Defaults to `0`.
*
*/
@Export(name="priority", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> priority;
/**
* @return The priority of this Batch Job, possible values can range from -1000 (lowest) to 1000 (highest). Defaults to `0`.
*
*/
public Output> priority() {
return Codegen.optional(this.priority);
}
/**
* The number of retries to each Batch Task belongs to this Batch Job. If this is set to `0`, the Batch service does not retry Tasks. If this is set to `-1`, the Batch service retries Batch Tasks without limit.
*
*/
@Export(name="taskRetryMaximum", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> taskRetryMaximum;
/**
* @return The number of retries to each Batch Task belongs to this Batch Job. If this is set to `0`, the Batch service does not retry Tasks. If this is set to `-1`, the Batch service retries Batch Tasks without limit.
*
*/
public Output> taskRetryMaximum() {
return Codegen.optional(this.taskRetryMaximum);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Job(java.lang.String name) {
this(name, JobArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Job(java.lang.String name, JobArgs 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 Job(java.lang.String name, JobArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:batch/job:Job", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Job(java.lang.String name, Output id, @Nullable JobState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:batch/job:Job", name, state, makeResourceOptions(options, id), false);
}
private static JobArgs makeArgs(JobArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? JobArgs.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())
.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 state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static Job get(java.lang.String name, Output id, @Nullable JobState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Job(name, id, state, options);
}
}