Class: AWSCDK::Batch::Ulimit

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

Overview

Sets limits for a resource with ulimit on linux systems.

Used by the Docker daemon.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hard_limit:, name:, soft_limit:) ⇒ Ulimit

Returns a new instance of Ulimit.

Parameters:

  • hard_limit (Numeric)

    The hard limit for this resource.

  • name (AWSCDK::Batch::UlimitName)

    The resource to limit.

  • soft_limit (Numeric)

    The reservation for this resource.



12
13
14
15
16
17
18
19
# File 'batch/ulimit.rb', line 12

def initialize(hard_limit:, name:, soft_limit:)
  @hard_limit = hard_limit
  Jsii::Type.check_type(@hard_limit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "hardLimit")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guVWxpbWl0TmFtZSJ9")), "name")
  @soft_limit = soft_limit
  Jsii::Type.check_type(@soft_limit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "softLimit")
end

Instance Attribute Details

#hard_limitNumeric (readonly)

The hard limit for this resource.

The container will be terminated if it exceeds this limit.

Returns:

  • (Numeric)


27
28
29
# File 'batch/ulimit.rb', line 27

def hard_limit
  @hard_limit
end

#nameAWSCDK::Batch::UlimitName (readonly)

The resource to limit.



31
32
33
# File 'batch/ulimit.rb', line 31

def name
  @name
end

#soft_limitNumeric (readonly)

The reservation for this resource.

The container will not be terminated if it exceeds this limit.

Returns:

  • (Numeric)


38
39
40
# File 'batch/ulimit.rb', line 38

def soft_limit
  @soft_limit
end

Class Method Details

.jsii_propertiesObject



40
41
42
43
44
45
46
# File 'batch/ulimit.rb', line 40

def self.jsii_properties
  {
    :hard_limit => "hardLimit",
    :name => "name",
    :soft_limit => "softLimit",
  }
end

Instance Method Details

#to_jsiiObject



48
49
50
51
52
53
54
55
56
# File 'batch/ulimit.rb', line 48

def to_jsii
  result = {}
  result.merge!({
    "hardLimit" => @hard_limit,
    "name" => @name,
    "softLimit" => @soft_limit,
  })
  result.compact
end