Class: AWSCDK::Batch::LinuxParameters
- Inherits:
-
Constructs::Construct
- Object
- Constructs::Construct
- AWSCDK::Batch::LinuxParameters
- Defined in:
- batch/linux_parameters.rb
Overview
Linux-specific options that are applied to the container.
Class Method Summary collapse
Instance Method Summary collapse
-
#add_devices(*device) ⇒ void
Adds one or more host devices to a container.
-
#add_tmpfs(*tmpfs) ⇒ void
Specifies the container path, mount options, and size (in MiB) of the tmpfs mount for a container.
-
#devices ⇒ Array<AWSCDK::Batch::Device>
deprecated
Deprecated.
- use addDevices instead
-
#init_process_enabled ⇒ Boolean?
Whether the init process is enabled.
-
#initialize(scope, id, props = nil) ⇒ LinuxParameters
constructor
Constructs a new instance of the LinuxParameters class.
-
#max_swap ⇒ AWSCDK::Size?
The max swap memory.
-
#node ⇒ Constructs::Node
The tree node.
-
#render_linux_parameters ⇒ AWSCDK::Batch::CfnJobDefinition::LinuxParametersProperty
Renders the Linux parameters to the Batch version of this resource, which does not have 'capabilities' and requires tmpfs.containerPath to be defined.
-
#shared_memory_size ⇒ AWSCDK::Size?
The shared memory size (in MiB).
-
#swappiness ⇒ Numeric?
The swappiness behavior.
-
#tmpfs ⇒ Array<AWSCDK::Batch::Tmpfs>
deprecated
Deprecated.
- use addTmpfs instead
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props = nil) ⇒ LinuxParameters
Constructs a new instance of the LinuxParameters class.
13 14 15 16 17 18 19 |
# File 'batch/linux_parameters.rb', line 13 def initialize(scope, id, props = nil) props = props.is_a?(Hash) ? ::AWSCDK::Batch::LinuxParametersProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guTGludXhQYXJhbWV0ZXJzUHJvcHMifQ==")), "props") unless props.nil? Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'batch/linux_parameters.rb', line 21 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :devices => { kind: :property, name: "devices", is_optional: false }, :tmpfs => { kind: :property, name: "tmpfs", is_optional: false }, :init_process_enabled => { kind: :property, name: "initProcessEnabled", is_optional: true }, :max_swap => { kind: :property, name: "maxSwap", is_optional: true }, :shared_memory_size => { kind: :property, name: "sharedMemorySize", is_optional: true }, :swappiness => { kind: :property, name: "swappiness", is_optional: true }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :add_devices => { kind: :method, name: "addDevices", is_optional: false }, :add_tmpfs => { kind: :method, name: "addTmpfs", is_optional: false }, :render_linux_parameters => { kind: :method, name: "renderLinuxParameters", is_optional: false }, } end |
Instance Method Details
#add_devices(*device) ⇒ void
This method returns an undefined value.
Adds one or more host devices to a container.
114 115 116 117 118 119 120 |
# File 'batch/linux_parameters.rb', line 114 def add_devices(*device) device.map! { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::Batch::Device.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } device.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guRGV2aWNlIn0=")), "device[#{index}]") end jsii_call_method("addDevices", [*device]) end |
#add_tmpfs(*tmpfs) ⇒ void
This method returns an undefined value.
Specifies the container path, mount options, and size (in MiB) of the tmpfs mount for a container.
Only works with EC2 launch type.
128 129 130 131 132 133 134 |
# File 'batch/linux_parameters.rb', line 128 def add_tmpfs(*tmpfs) tmpfs.map! { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::Batch::Tmpfs.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } tmpfs.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guVG1wZnMifQ==")), "tmpfs[#{index}]") end jsii_call_method("addTmpfs", [*tmpfs]) end |
#devices ⇒ Array<AWSCDK::Batch::Device>
- use addDevices instead
47 48 49 |
# File 'batch/linux_parameters.rb', line 47 def devices() jsii_get_property("devices") end |
#init_process_enabled ⇒ Boolean?
Whether the init process is enabled.
60 61 62 |
# File 'batch/linux_parameters.rb', line 60 def init_process_enabled() jsii_get_property("initProcessEnabled") end |
#max_swap ⇒ AWSCDK::Size?
The max swap memory.
67 68 69 |
# File 'batch/linux_parameters.rb', line 67 def max_swap() jsii_get_property("maxSwap") end |
#node ⇒ Constructs::Node
The tree node.
41 42 43 |
# File 'batch/linux_parameters.rb', line 41 def node() jsii_get_property("node") end |
#render_linux_parameters ⇒ AWSCDK::Batch::CfnJobDefinition::LinuxParametersProperty
Renders the Linux parameters to the Batch version of this resource, which does not have 'capabilities' and requires tmpfs.containerPath to be defined.
139 140 141 |
# File 'batch/linux_parameters.rb', line 139 def render_linux_parameters() jsii_call_method("renderLinuxParameters", []) end |
#shared_memory_size ⇒ AWSCDK::Size?
The shared memory size (in MiB).
Not valid for Fargate launch type
76 77 78 |
# File 'batch/linux_parameters.rb', line 76 def shared_memory_size() jsii_get_property("sharedMemorySize") end |
#swappiness ⇒ Numeric?
The swappiness behavior.
83 84 85 |
# File 'batch/linux_parameters.rb', line 83 def swappiness() jsii_get_property("swappiness") end |
#tmpfs ⇒ Array<AWSCDK::Batch::Tmpfs>
- use addTmpfs instead
53 54 55 |
# File 'batch/linux_parameters.rb', line 53 def tmpfs() jsii_get_property("tmpfs") end |
#to_string ⇒ String
Returns a string representation of this construct.
90 91 92 |
# File 'batch/linux_parameters.rb', line 90 def to_string() jsii_call_method("toString", []) end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
103 104 105 106 107 108 |
# File 'batch/linux_parameters.rb', line 103 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |