Class: AWSCDK::Batch::LinuxParameters

Inherits:
Constructs::Construct
  • Object
show all
Defined in:
batch/linux_parameters.rb

Overview

Linux-specific options that are applied to the container.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scope, id, props = nil) ⇒ LinuxParameters

Constructs a new instance of the LinuxParameters class.

Parameters:



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_methodsObject



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.

Parameters:



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.

Parameters:



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

#devicesArray<AWSCDK::Batch::Device>

Deprecated.
  • use addDevices instead

Returns:



47
48
49
# File 'batch/linux_parameters.rb', line 47

def devices()
  jsii_get_property("devices")
end

#init_process_enabledBoolean?

Whether the init process is enabled.

Returns:

  • (Boolean, nil)


60
61
62
# File 'batch/linux_parameters.rb', line 60

def init_process_enabled()
  jsii_get_property("initProcessEnabled")
end

#max_swapAWSCDK::Size?

The max swap memory.

Returns:



67
68
69
# File 'batch/linux_parameters.rb', line 67

def max_swap()
  jsii_get_property("maxSwap")
end

#nodeConstructs::Node

The tree node.

Returns:

  • (Constructs::Node)


41
42
43
# File 'batch/linux_parameters.rb', line 41

def node()
  jsii_get_property("node")
end

#render_linux_parametersAWSCDK::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_sizeAWSCDK::Size?

The shared memory size (in MiB).

Not valid for Fargate launch type

Returns:



76
77
78
# File 'batch/linux_parameters.rb', line 76

def shared_memory_size()
  jsii_get_property("sharedMemorySize")
end

#swappinessNumeric?

The swappiness behavior.

Returns:

  • (Numeric, nil)


83
84
85
# File 'batch/linux_parameters.rb', line 83

def swappiness()
  jsii_get_property("swappiness")
end

#tmpfsArray<AWSCDK::Batch::Tmpfs>

Deprecated.
  • use addTmpfs instead

Returns:



53
54
55
# File 'batch/linux_parameters.rb', line 53

def tmpfs()
  jsii_get_property("tmpfs")
end

#to_stringString

Returns a string representation of this construct.

Returns:

  • (String)


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.

Parameters:

  • mixins (Array<Constructs::IMixin>)

    The mixins to apply.

Returns:

  • (Constructs::IConstruct)

    This construct for chaining



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