Class Reason
Common job exit reasons.
Inheritance
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Reason : DeputyBase
Syntax (vb)
Public Class Reason
Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
var jobDefn = new EcsJobDefinition(this, "JobDefn", new EcsJobDefinitionProps {
Container = new EcsEc2ContainerDefinition(this, "containerDefn", new EcsEc2ContainerDefinitionProps {
Image = ContainerImage.FromRegistry("public.ecr.aws/amazonlinux/amazonlinux:latest"),
Memory = Size.Mebibytes(2048),
Cpu = 256
}),
RetryAttempts = 5,
RetryStrategies = new [] { RetryStrategy.Of(Action.EXIT, Reason.CANNOT_PULL_CONTAINER) }
});
jobDefn.AddRetryStrategy(RetryStrategy.Of(Action.EXIT, Reason.SPOT_INSTANCE_RECLAIMED));
jobDefn.AddRetryStrategy(RetryStrategy.Of(Action.EXIT, Reason.CANNOT_PULL_CONTAINER));
jobDefn.AddRetryStrategy(RetryStrategy.Of(Action.EXIT, Reason.Custom(new CustomReason {
OnExitCode = "40*",
OnReason = "some reason"
})));
Synopsis
Constructors
Reason() | |
Reason(By |
Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Reason(Deputy |
Used by jsii to construct an instance of this class from DeputyProps |
Properties
CANNOT_PULL_CONTAINER | Will only match if the Docker container could not be pulled. |
NON_ZERO_EXIT_CODE | Will match any non-zero exit code. |
SPOT_INSTANCE_RECLAIMED | Will only match if the Spot instance executing the job was reclaimed. |
Methods
Custom(ICustom |
A custom Reason that can match on multiple conditions. |
Constructors
Reason()
public Reason()
Reason(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Reason(ByRefValue reference)
Parameters
- reference Amazon.
JSII. Runtime. Deputy. By Ref Value The Javascript-owned object reference
Reason(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Reason(DeputyBase.DeputyProps props)
Parameters
- props Amazon.
JSII. Runtime. Deputy. Deputy Base. Deputy Props The deputy props
Properties
CANNOT_PULL_CONTAINER
Will only match if the Docker container could not be pulled.
public static Reason CANNOT_PULL_CONTAINER { get; }
Property Value
NON_ZERO_EXIT_CODE
Will match any non-zero exit code.
public static Reason NON_ZERO_EXIT_CODE { get; }
Property Value
SPOT_INSTANCE_RECLAIMED
Will only match if the Spot instance executing the job was reclaimed.
public static Reason SPOT_INSTANCE_RECLAIMED { get; }
Property Value
Methods
Custom(ICustomReason)
A custom Reason that can match on multiple conditions.
public static Reason Custom(ICustomReason customReasonProps)
Parameters
- customReasonProps ICustom
Reason
Returns
Remarks
Note that all specified conditions must be met for this reason to match.