Class: AWSCDK::Batch::JobQueueProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Batch::JobQueueProps
- Defined in:
- batch/job_queue_props.rb
Overview
Props to configure a JobQueue.
Instance Attribute Summary collapse
-
#compute_environments ⇒ Array<AWSCDK::Batch::OrderedComputeEnvironment>?
readonly
The set of compute environments mapped to a job queue and their order relative to each other.
-
#enabled ⇒ Boolean?
readonly
If the job queue is enabled, it is able to accept jobs.
-
#job_queue_name ⇒ String?
readonly
The name of the job queue.
-
#job_state_time_limit_actions ⇒ Array<AWSCDK::Batch::JobStateTimeLimitAction>?
readonly
The set of actions that AWS Batch perform on jobs that remain at the head of the job queue in the specified state longer than specified times.
-
#priority ⇒ Numeric?
readonly
The priority of the job queue.
-
#scheduling_policy ⇒ AWSCDK::Interfaces::AWSBatch::ISchedulingPolicyRef?
readonly
The SchedulingPolicy for this JobQueue.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(compute_environments: nil, enabled: nil, job_queue_name: nil, job_state_time_limit_actions: nil, priority: nil, scheduling_policy: nil) ⇒ JobQueueProps
constructor
A new instance of JobQueueProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(compute_environments: nil, enabled: nil, job_queue_name: nil, job_state_time_limit_actions: nil, priority: nil, scheduling_policy: nil) ⇒ JobQueueProps
Returns a new instance of JobQueueProps.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'batch/job_queue_props.rb', line 13 def initialize(compute_environments: nil, enabled: nil, job_queue_name: nil, job_state_time_limit_actions: nil, priority: nil, scheduling_policy: nil) @compute_environments = compute_environments.is_a?(Array) ? compute_environments.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::Batch::OrderedComputeEnvironment.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : compute_environments Jsii::Type.check_type(@compute_environments, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYXRjaC5PcmRlcmVkQ29tcHV0ZUVudmlyb25tZW50In0sImtpbmQiOiJhcnJheSJ9fQ==")), "computeEnvironments") unless @compute_environments.nil? @enabled = enabled Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil? @job_queue_name = job_queue_name Jsii::Type.check_type(@job_queue_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "jobQueueName") unless @job_queue_name.nil? @job_state_time_limit_actions = job_state_time_limit_actions.is_a?(Array) ? job_state_time_limit_actions.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::Batch::JobStateTimeLimitAction.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : job_state_time_limit_actions Jsii::Type.check_type(@job_state_time_limit_actions, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iYXRjaC5Kb2JTdGF0ZVRpbWVMaW1pdEFjdGlvbiJ9LCJraW5kIjoiYXJyYXkifX0=")), "jobStateTimeLimitActions") unless @job_state_time_limit_actions.nil? @priority = priority Jsii::Type.check_type(@priority, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "priority") unless @priority.nil? @scheduling_policy = scheduling_policy Jsii::Type.check_type(@scheduling_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19iYXRjaC5JU2NoZWR1bGluZ1BvbGljeVJlZiJ9")), "schedulingPolicy") unless @scheduling_policy.nil? end |
Instance Attribute Details
#compute_environments ⇒ Array<AWSCDK::Batch::OrderedComputeEnvironment>? (readonly)
Default: none
The set of compute environments mapped to a job queue and their order relative to each other.
The job scheduler uses this parameter to determine which compute environment runs a specific job. Compute environments must be in the VALID state before you can associate them with a job queue. You can associate up to three compute environments with a job queue. All of the compute environments must be either EC2 (EC2 or SPOT) or Fargate (FARGATE or FARGATE_SPOT); EC2 and Fargate compute environments can't be mixed.
Note: All compute environments that are associated with a job queue must share the same architecture. AWS Batch doesn't support mixing compute environment architecture types in a single job queue.
41 42 43 |
# File 'batch/job_queue_props.rb', line 41 def compute_environments @compute_environments end |
#enabled ⇒ Boolean? (readonly)
Default: true
If the job queue is enabled, it is able to accept jobs.
Otherwise, new jobs can't be added to the queue, but jobs already in the queue can finish.
48 49 50 |
# File 'batch/job_queue_props.rb', line 48 def enabled @enabled end |
#job_queue_name ⇒ String? (readonly)
Default: - no name
The name of the job queue.
It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_)
56 57 58 |
# File 'batch/job_queue_props.rb', line 56 def job_queue_name @job_queue_name end |
#job_state_time_limit_actions ⇒ Array<AWSCDK::Batch::JobStateTimeLimitAction>? (readonly)
Default: - no actions
The set of actions that AWS Batch perform on jobs that remain at the head of the job queue in the specified state longer than specified times.
61 62 63 |
# File 'batch/job_queue_props.rb', line 61 def job_state_time_limit_actions @job_state_time_limit_actions end |
#priority ⇒ Numeric? (readonly)
Default: 1
The priority of the job queue.
Job queues with a higher priority are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority of 10 is given scheduling preference over a job queue with a priority of 1.
70 71 72 |
# File 'batch/job_queue_props.rb', line 70 def priority @priority end |
#scheduling_policy ⇒ AWSCDK::Interfaces::AWSBatch::ISchedulingPolicyRef? (readonly)
Default: - no scheduling policy
The SchedulingPolicy for this JobQueue.
Instructs the Scheduler how to schedule different jobs.
77 78 79 |
# File 'batch/job_queue_props.rb', line 77 def scheduling_policy @scheduling_policy end |
Class Method Details
.jsii_properties ⇒ Object
79 80 81 82 83 84 85 86 87 88 |
# File 'batch/job_queue_props.rb', line 79 def self.jsii_properties { :compute_environments => "computeEnvironments", :enabled => "enabled", :job_queue_name => "jobQueueName", :job_state_time_limit_actions => "jobStateTimeLimitActions", :priority => "priority", :scheduling_policy => "schedulingPolicy", } end |
Instance Method Details
#to_jsii ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'batch/job_queue_props.rb', line 90 def to_jsii result = {} result.merge!({ "computeEnvironments" => @compute_environments, "enabled" => @enabled, "jobQueueName" => @job_queue_name, "jobStateTimeLimitActions" => @job_state_time_limit_actions, "priority" => @priority, "schedulingPolicy" => @scheduling_policy, }) result.compact end |