Package org.cdk8s.plus20
Class Job
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- software.constructs.Construct
-
- org.cdk8s.plus20.Resource
-
- org.cdk8s.plus20.Job
-
- All Implemented Interfaces:
IPodSpec,IPodTemplate,IResource,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.54.0 (build b1b977a)", date="2022-03-07T02:28:27.951Z") @Stability(Stable) public class Job extends Resource implements IPodTemplate
A Job creates one or more Pods and ensures that a specified number of them successfully terminate.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJob.BuilderA fluent builder forJob.-
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
-
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
-
Nested classes/interfaces inherited from interface org.cdk8s.plus20.IPodTemplate
IPodTemplate.Jsii$Default, IPodTemplate.Jsii$Proxy
-
Nested classes/interfaces inherited from interface org.cdk8s.plus20.IResource
IResource.Jsii$Default
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJob(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)protectedJob(software.amazon.jsii.JsiiObjectRef objRef)Job(software.constructs.Construct scope, String id)Job(software.constructs.Construct scope, String id, JobProps props)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContaineraddContainer(ContainerProps container)Add a container to the pod.voidaddVolume(Volume volume)Add a volume to the pod.org.cdk8s.DurationgetActiveDeadline()Duration before job is terminated.protected org.cdk8s.ApiObjectgetApiObject()The underlying cdk8s API object.NumbergetBackoffLimit()Number of retries before marking failed.List<Container>getContainers()The containers belonging to the pod.org.cdk8s.ApiObjectMetadataDefinitiongetPodMetadata()Provides read/write access to the underlying pod metadata of the resource.RestartPolicygetRestartPolicy()Restart policy for all containers within the pod.IServiceAccountgetServiceAccount()The service account used to run this pod.org.cdk8s.DurationgetTtlAfterFinished()TTL before the job is deleted after it is finished.List<Volume>getVolumes()The volumes associated with this pod.-
Methods inherited from class org.cdk8s.plus20.Resource
getMetadata, getName
-
Methods inherited from class software.constructs.Construct
onPrepare, onSynthesize, onValidate, toString
-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Constructor Detail
-
Job
protected Job(software.amazon.jsii.JsiiObjectRef objRef)
-
Job
protected Job(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
Job
@Stability(Stable) public Job(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable JobProps props)- Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
Job
@Stability(Stable) public Job(@NotNull software.constructs.Construct scope, @NotNull String id)- Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Detail
-
addContainer
@Stability(Stable) @NotNull public Container addContainer(@NotNull ContainerProps container)
Add a container to the pod.- Specified by:
addContainerin interfaceIPodSpec- Parameters:
container- This parameter is required.
-
addVolume
@Stability(Stable) public void addVolume(@NotNull Volume volume)Add a volume to the pod.
-
getApiObject
@Stability(Stable) @NotNull protected org.cdk8s.ApiObject getApiObject()
The underlying cdk8s API object.- Specified by:
getApiObjectin classResource- See Also:
base.Resource.apiObject
-
getContainers
@Stability(Stable) @NotNull public List<Container> getContainers()
The containers belonging to the pod.Use
addContainerto add containers.- Specified by:
getContainersin interfaceIPodSpec
-
getPodMetadata
@Stability(Stable) @NotNull public org.cdk8s.ApiObjectMetadataDefinition getPodMetadata()
Provides read/write access to the underlying pod metadata of the resource.- Specified by:
getPodMetadatain interfaceIPodTemplate
-
getVolumes
@Stability(Stable) @NotNull public List<Volume> getVolumes()
The volumes associated with this pod.Use
addVolumeto add volumes.- Specified by:
getVolumesin interfaceIPodSpec
-
getActiveDeadline
@Stability(Stable) @Nullable public org.cdk8s.Duration getActiveDeadline()
Duration before job is terminated.If undefined, there is no deadline.
-
getBackoffLimit
@Stability(Stable) @Nullable public Number getBackoffLimit()
Number of retries before marking failed.
-
getRestartPolicy
@Stability(Stable) @Nullable public RestartPolicy getRestartPolicy()
Restart policy for all containers within the pod.- Specified by:
getRestartPolicyin interfaceIPodSpec
-
getServiceAccount
@Stability(Stable) @Nullable public IServiceAccount getServiceAccount()
The service account used to run this pod.- Specified by:
getServiceAccountin interfaceIPodSpec
-
getTtlAfterFinished
@Stability(Stable) @Nullable public org.cdk8s.Duration getTtlAfterFinished()
TTL before the job is deleted after it is finished.
-
-