java.lang.Object
java.lang.Enum<Action>
software.amazon.awscdk.services.batch.Action
All Implemented Interfaces:
Serializable, Comparable<Action>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:23:57.579Z") @Stability(Stable) public enum Action extends Enum<Action>
The Action to take when all specified conditions in a RetryStrategy are met.

Example:

 EcsJobDefinition jobDefn = EcsJobDefinition.Builder.create(this, "JobDefn")
         .container(EcsEc2ContainerDefinition.Builder.create(this, "containerDefn")
                 .image(ContainerImage.fromRegistry("public.ecr.aws/amazonlinux/amazonlinux:latest"))
                 .memory(Size.mebibytes(2048))
                 .cpu(256)
                 .build())
         .retryAttempts(5)
         .retryStrategies(List.of(RetryStrategy.of(Action.EXIT, Reason.CANNOT_PULL_CONTAINER)))
         .build();
 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(CustomReason.builder()
         .onExitCode("40*")
         .onReason("some reason")
         .build())));
 
  • Enum Constant Details

    • EXIT

      @Stability(Stable) public static final Action EXIT
      The job will not retry.
    • RETRY

      @Stability(Stable) public static final Action RETRY
      The job will retry.

      It can be retried up to the number of times specified in retryAttempts.

  • Method Details

    • values

      public static Action[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Action valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null