Class: AWSCDK::Batch::CfnJobDefinition::EvaluateOnExitProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
batch/cfn_job_definition.rb

Overview

Specifies an array of up to 5 conditions to be met, and an action to take ( RETRY or EXIT ) if all conditions are met.

If none of the EvaluateOnExit conditions in a RetryStrategy match, then the job is retried.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action:, on_exit_code: nil, on_reason: nil, on_status_reason: nil) ⇒ EvaluateOnExitProperty

Returns a new instance of EvaluateOnExitProperty.

Parameters:

  • action (String)

    Specifies the action to take if all of the specified conditions ( onStatusReason , onReason , and onExitCode ) are met.

  • on_exit_code (String, nil) (defaults to: nil)

    Contains a glob pattern to match against the decimal representation of the ExitCode returned for a job.

  • on_reason (String, nil) (defaults to: nil)

    Contains a glob pattern to match against the Reason returned for a job.

  • on_status_reason (String, nil) (defaults to: nil)

    Contains a glob pattern to match against the StatusReason returned for a job.



2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
# File 'batch/cfn_job_definition.rb', line 2043

def initialize(action:, on_exit_code: nil, on_reason: nil, on_status_reason: nil)
  @action = action
  Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "action")
  @on_exit_code = on_exit_code
  Jsii::Type.check_type(@on_exit_code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "onExitCode") unless @on_exit_code.nil?
  @on_reason = on_reason
  Jsii::Type.check_type(@on_reason, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "onReason") unless @on_reason.nil?
  @on_status_reason = on_status_reason
  Jsii::Type.check_type(@on_status_reason, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "onStatusReason") unless @on_status_reason.nil?
end

Instance Attribute Details

#actionString (readonly)

Specifies the action to take if all of the specified conditions ( onStatusReason , onReason , and onExitCode ) are met.

The values aren't case sensitive.



2060
2061
2062
# File 'batch/cfn_job_definition.rb', line 2060

def action
  @action
end

#on_exit_codeString? (readonly)

Contains a glob pattern to match against the decimal representation of the ExitCode returned for a job.

The pattern can be up to 512 characters long. It can contain only numbers, and can end with an asterisk (*) so that only the start of the string needs to be an exact match.

The string can contain up to 512 characters.



2069
2070
2071
# File 'batch/cfn_job_definition.rb', line 2069

def on_exit_code
  @on_exit_code
end

#on_reasonString? (readonly)

Contains a glob pattern to match against the Reason returned for a job.

The pattern can contain up to 512 characters. It can contain letters, numbers, periods (.), colons (:), and white space (including spaces and tabs). It can optionally end with an asterisk (*) so that only the start of the string needs to be an exact match.



2076
2077
2078
# File 'batch/cfn_job_definition.rb', line 2076

def on_reason
  @on_reason
end

#on_status_reasonString? (readonly)

Contains a glob pattern to match against the StatusReason returned for a job.

The pattern can contain up to 512 characters. It can contain letters, numbers, periods (.), colons (:), and white spaces (including spaces or tabs). It can optionally end with an asterisk (*) so that only the start of the string needs to be an exact match.



2083
2084
2085
# File 'batch/cfn_job_definition.rb', line 2083

def on_status_reason
  @on_status_reason
end

Class Method Details

.jsii_propertiesObject



2085
2086
2087
2088
2089
2090
2091
2092
# File 'batch/cfn_job_definition.rb', line 2085

def self.jsii_properties
  {
    :action => "action",
    :on_exit_code => "onExitCode",
    :on_reason => "onReason",
    :on_status_reason => "onStatusReason",
  }
end

Instance Method Details

#to_jsiiObject



2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
# File 'batch/cfn_job_definition.rb', line 2094

def to_jsii
  result = {}
  result.merge!({
    "action" => @action,
    "onExitCode" => @on_exit_code,
    "onReason" => @on_reason,
    "onStatusReason" => @on_status_reason,
  })
  result.compact
end