@Generated(value="jsii-pacmak/1.34.0 (build 9b72778)", date="2021-09-21T00:27:37.483Z") @Stability(value=Stable) public class Job extends Resource implements IPodTemplate
As pods successfully complete, the Job tracks the successful completions. When a specified number of successful completions is reached, the task (ie, Job) is complete. Deleting a Job will clean up the Pods it created. A simple case is to create one Job object in order to reliably run one Pod to completion. The Job object will start a new Pod if the first Pod fails or is deleted (for example due to a node hardware failure or a node reboot). You can also use a Job to run multiple Pods in parallel.
| Modifier and Type | Class and Description |
|---|---|
static class |
Job.Builder
A fluent builder for
Job. |
software.amazon.jsii.JsiiObject.InitializationModeIPodTemplate.Jsii$Default, IPodTemplate.Jsii$ProxyIResource.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
Job(software.constructs.Construct scope,
String id) |
|
Job(software.constructs.Construct scope,
String id,
JobProps props) |
protected |
Job(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Job(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
Container |
addContainer(ContainerProps container)
Add a container to the pod.
|
void |
addVolume(Volume volume)
Add a volume to the pod.
|
org.cdk8s.Duration |
getActiveDeadline()
Duration before job is terminated.
|
protected org.cdk8s.ApiObject |
getApiObject()
The underlying cdk8s API object.
|
Number |
getBackoffLimit()
Number of retries before marking failed.
|
List<Container> |
getContainers()
The containers belonging to the pod.
|
org.cdk8s.ApiObjectMetadataDefinition |
getPodMetadata()
Provides read/write access to the underlying pod metadata of the resource.
|
RestartPolicy |
getRestartPolicy()
Restart policy for all containers within the pod.
|
IServiceAccount |
getServiceAccount()
The service account used to run this pod.
|
org.cdk8s.Duration |
getTtlAfterFinished()
TTL before the job is deleted after it is finished.
|
List<Volume> |
getVolumes()
The volumes associated with this pod.
|
getMetadata, getNameonPrepare, onSynthesize, onValidate, toStringjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected Job(software.amazon.jsii.JsiiObjectRef objRef)
protected Job(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public Job(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
JobProps props)
scope - This parameter is required.id - This parameter is required.props - @Stability(value=Stable)
public Job(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - This parameter is required.id - This parameter is required.@Stability(value=Stable) @NotNull public Container addContainer(@NotNull ContainerProps container)
addContainer in interface IPodSpeccontainer - This parameter is required.@Stability(value=Stable)
public void addVolume(@NotNull
Volume volume)
@Stability(value=Stable) @NotNull protected org.cdk8s.ApiObject getApiObject()
getApiObject in class Resourcebase.Resource.apiObject@Stability(value=Stable) @NotNull public List<Container> getContainers()
Use addContainer to add containers.
getContainers in interface IPodSpec@Stability(value=Stable) @NotNull public org.cdk8s.ApiObjectMetadataDefinition getPodMetadata()
getPodMetadata in interface IPodTemplate@Stability(value=Stable) @NotNull public List<Volume> getVolumes()
Use addVolume to add volumes.
getVolumes in interface IPodSpec@Stability(value=Stable) @Nullable public org.cdk8s.Duration getActiveDeadline()
If undefined, there is no deadline.
@Stability(value=Stable) @Nullable public Number getBackoffLimit()
@Stability(value=Stable) @Nullable public RestartPolicy getRestartPolicy()
getRestartPolicy in interface IPodSpec@Stability(value=Stable) @Nullable public IServiceAccount getServiceAccount()
getServiceAccount in interface IPodSpec@Stability(value=Stable) @Nullable public org.cdk8s.Duration getTtlAfterFinished()
Copyright © 2021. All rights reserved.