Class: AWSCDK::Batch::HostVolume

Inherits:
ECSVolume
  • Object
show all
Defined in:
batch/host_volume.rb

Overview

Creates a Host volume.

This volume will persist on the host at the specified host_path. If the host_path is not specified, Docker will choose the host path. In this case, the data may not persist after the containers that use it stop running.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ HostVolume

Returns a new instance of HostVolume.

Parameters:



13
14
15
16
17
# File 'batch/host_volume.rb', line 13

def initialize(options)
  options = options.is_a?(Hash) ? ::AWSCDK::Batch::HostVolumeOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmF0Y2guSG9zdFZvbHVtZU9wdGlvbnMifQ==")), "options")
  Jsii::Object.instance_method(:initialize).bind(self).call(options)
end

Class Method Details

.is_host_volume(x) ⇒ Boolean

returns true if x is a HostVolume, false otherwise.

Parameters:

  • x (Object)

Returns:

  • (Boolean)


32
33
34
35
# File 'batch/host_volume.rb', line 32

def self.is_host_volume(x)
  Jsii::Type.check_type(x, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "x")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_batch.HostVolume", "isHostVolume", [x])
end

.jsii_overridable_methodsObject



19
20
21
22
23
24
25
26
# File 'batch/host_volume.rb', line 19

def self.jsii_overridable_methods
  {
    :container_path => { kind: :property, name: "containerPath", is_optional: false },
    :name => { kind: :property, name: "name", is_optional: false },
    :readonly => { kind: :property, name: "readonly", is_optional: true },
    :host_path => { kind: :property, name: "hostPath", is_optional: true },
  }
end

Instance Method Details

#container_pathString

The path on the container that this volume will be mounted to.

Returns:

  • (String)


40
41
42
# File 'batch/host_volume.rb', line 40

def container_path()
  jsii_get_property("containerPath")
end

#host_pathString?

The path on the host machine this container will have access to.

Returns:

  • (String, nil)


62
63
64
# File 'batch/host_volume.rb', line 62

def host_path()
  jsii_get_property("hostPath")
end

#nameString

The name of this volume.

Returns:

  • (String)


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

def name()
  jsii_get_property("name")
end

#readonlyBoolean?

Note:

Default: false

Whether or not the container has readonly access to this volume.

Returns:

  • (Boolean, nil)


55
56
57
# File 'batch/host_volume.rb', line 55

def readonly()
  jsii_get_property("readonly")
end