com.pulumi.azure.batch.outputs.PoolStartTask 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.outputs;
import com.pulumi.azure.batch.outputs.PoolStartTaskContainer;
import com.pulumi.azure.batch.outputs.PoolStartTaskResourceFile;
import com.pulumi.azure.batch.outputs.PoolStartTaskUserIdentity;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
@CustomType
public final class PoolStartTask {
/**
* @return The command line executed by the start task.
*
*/
private String commandLine;
/**
* @return A map of strings (key,value) that represents the environment variables to set in the start task.
*
*/
private @Nullable Map commonEnvironmentProperties;
/**
* @return A `container` block is the settings for the container under which the start task runs as defined below. When this is specified, all directories recursively below the `AZ_BATCH_NODE_ROOT_DIR` (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
*
*/
private @Nullable List containers;
/**
* @return One or more `resource_file` blocks that describe the files to be downloaded to a compute node as defined below.
*
*/
private @Nullable List resourceFiles;
/**
* @return The number of retry count.
*
*/
private @Nullable Integer taskRetryMaximum;
/**
* @return A `user_identity` block that describes the user identity under which the start task runs as defined below.
*
*/
private PoolStartTaskUserIdentity userIdentity;
/**
* @return A flag that indicates if the Batch pool should wait for the start task to be completed. Default to `false`.
*
*/
private @Nullable Boolean waitForSuccess;
private PoolStartTask() {}
/**
* @return The command line executed by the start task.
*
*/
public String commandLine() {
return this.commandLine;
}
/**
* @return A map of strings (key,value) that represents the environment variables to set in the start task.
*
*/
public Map commonEnvironmentProperties() {
return this.commonEnvironmentProperties == null ? Map.of() : this.commonEnvironmentProperties;
}
/**
* @return A `container` block is the settings for the container under which the start task runs as defined below. When this is specified, all directories recursively below the `AZ_BATCH_NODE_ROOT_DIR` (the root of Azure Batch directories on the node) are mapped into the container, all task environment variables are mapped into the container, and the task command line is executed in the container.
*
*/
public List containers() {
return this.containers == null ? List.of() : this.containers;
}
/**
* @return One or more `resource_file` blocks that describe the files to be downloaded to a compute node as defined below.
*
*/
public List resourceFiles() {
return this.resourceFiles == null ? List.of() : this.resourceFiles;
}
/**
* @return The number of retry count.
*
*/
public Optional taskRetryMaximum() {
return Optional.ofNullable(this.taskRetryMaximum);
}
/**
* @return A `user_identity` block that describes the user identity under which the start task runs as defined below.
*
*/
public PoolStartTaskUserIdentity userIdentity() {
return this.userIdentity;
}
/**
* @return A flag that indicates if the Batch pool should wait for the start task to be completed. Default to `false`.
*
*/
public Optional waitForSuccess() {
return Optional.ofNullable(this.waitForSuccess);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(PoolStartTask defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private String commandLine;
private @Nullable Map commonEnvironmentProperties;
private @Nullable List containers;
private @Nullable List resourceFiles;
private @Nullable Integer taskRetryMaximum;
private PoolStartTaskUserIdentity userIdentity;
private @Nullable Boolean waitForSuccess;
public Builder() {}
public Builder(PoolStartTask defaults) {
Objects.requireNonNull(defaults);
this.commandLine = defaults.commandLine;
this.commonEnvironmentProperties = defaults.commonEnvironmentProperties;
this.containers = defaults.containers;
this.resourceFiles = defaults.resourceFiles;
this.taskRetryMaximum = defaults.taskRetryMaximum;
this.userIdentity = defaults.userIdentity;
this.waitForSuccess = defaults.waitForSuccess;
}
@CustomType.Setter
public Builder commandLine(String commandLine) {
if (commandLine == null) {
throw new MissingRequiredPropertyException("PoolStartTask", "commandLine");
}
this.commandLine = commandLine;
return this;
}
@CustomType.Setter
public Builder commonEnvironmentProperties(@Nullable Map commonEnvironmentProperties) {
this.commonEnvironmentProperties = commonEnvironmentProperties;
return this;
}
@CustomType.Setter
public Builder containers(@Nullable List containers) {
this.containers = containers;
return this;
}
public Builder containers(PoolStartTaskContainer... containers) {
return containers(List.of(containers));
}
@CustomType.Setter
public Builder resourceFiles(@Nullable List resourceFiles) {
this.resourceFiles = resourceFiles;
return this;
}
public Builder resourceFiles(PoolStartTaskResourceFile... resourceFiles) {
return resourceFiles(List.of(resourceFiles));
}
@CustomType.Setter
public Builder taskRetryMaximum(@Nullable Integer taskRetryMaximum) {
this.taskRetryMaximum = taskRetryMaximum;
return this;
}
@CustomType.Setter
public Builder userIdentity(PoolStartTaskUserIdentity userIdentity) {
if (userIdentity == null) {
throw new MissingRequiredPropertyException("PoolStartTask", "userIdentity");
}
this.userIdentity = userIdentity;
return this;
}
@CustomType.Setter
public Builder waitForSuccess(@Nullable Boolean waitForSuccess) {
this.waitForSuccess = waitForSuccess;
return this;
}
public PoolStartTask build() {
final var _resultValue = new PoolStartTask();
_resultValue.commandLine = commandLine;
_resultValue.commonEnvironmentProperties = commonEnvironmentProperties;
_resultValue.containers = containers;
_resultValue.resourceFiles = resourceFiles;
_resultValue.taskRetryMaximum = taskRetryMaximum;
_resultValue.userIdentity = userIdentity;
_resultValue.waitForSuccess = waitForSuccess;
return _resultValue;
}
}
}