Class: AWSCDK::Batch::CfnJobQueue::JobStateTimeLimitActionProperty

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

Overview

Specifies an action that AWS Batch will take after the job has remained at the head of the queue in the specified state for longer than the specified time.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action:, max_time_seconds:, reason:, state:) ⇒ JobStateTimeLimitActionProperty

Returns a new instance of JobStateTimeLimitActionProperty.

Parameters:

  • action (String)

    The action to take when a job is at the head of the job queue in the specified state for the specified period of time.

  • max_time_seconds (Numeric)

    The approximate amount of time, in seconds, that must pass with the job in the specified state before the action is taken.

  • reason (String)

    The reason to log for the action being taken.

  • state (String)

    The state of the job needed to trigger the action.



674
675
676
677
678
679
680
681
682
683
# File 'batch/cfn_job_queue.rb', line 674

def initialize(action:, max_time_seconds:, reason:, state:)
  @action = action
  Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "action")
  @max_time_seconds = max_time_seconds
  Jsii::Type.check_type(@max_time_seconds, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxTimeSeconds")
  @reason = reason
  Jsii::Type.check_type(@reason, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "reason")
  @state = state
  Jsii::Type.check_type(@state, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "state")
end

Instance Attribute Details

#actionString (readonly)

The action to take when a job is at the head of the job queue in the specified state for the specified period of time.

The only supported value is CANCEL , which will cancel the job.



691
692
693
# File 'batch/cfn_job_queue.rb', line 691

def action
  @action
end

#max_time_secondsNumeric (readonly)

The approximate amount of time, in seconds, that must pass with the job in the specified state before the action is taken.

The minimum value is 600 (10 minutes) and the maximum value is 86,400 (24 hours).



698
699
700
# File 'batch/cfn_job_queue.rb', line 698

def max_time_seconds
  @max_time_seconds
end

#reasonString (readonly)

The reason to log for the action being taken.



703
704
705
# File 'batch/cfn_job_queue.rb', line 703

def reason
  @reason
end

#stateString (readonly)

The state of the job needed to trigger the action.

The only supported value is RUNNABLE .



710
711
712
# File 'batch/cfn_job_queue.rb', line 710

def state
  @state
end

Class Method Details

.jsii_propertiesObject



712
713
714
715
716
717
718
719
# File 'batch/cfn_job_queue.rb', line 712

def self.jsii_properties
  {
    :action => "action",
    :max_time_seconds => "maxTimeSeconds",
    :reason => "reason",
    :state => "state",
  }
end

Instance Method Details

#to_jsiiObject



721
722
723
724
725
726
727
728
729
730
# File 'batch/cfn_job_queue.rb', line 721

def to_jsii
  result = {}
  result.merge!({
    "action" => @action,
    "maxTimeSeconds" => @max_time_seconds,
    "reason" => @reason,
    "state" => @state,
  })
  result.compact
end