class Marathon::ContainerDocker

This class represents a Marathon Container docker information. See mesosphere.github.io/marathon/docs/native-docker.html for full details.

Constants

ACCESSORS
DEFAULTS

Attributes

portMappings[R]

Public Class Methods

new(hash) click to toggle source

Create a new container docker object. hash: Hash returned by API.

Calls superclass method Marathon::Base::new
# File lib/marathon/container_docker.rb, line 15
def initialize(hash)
  super(Marathon::Util.merge_keywordized_hash(DEFAULTS, hash), ACCESSORS)
  Marathon::Util.validate_choice('network', network, %w[BRIDGE HOST])
  Marathon::Util.validate_choice('privileged', privileged, ['true', 'false', true, false])
  raise Marathon::Error::ArgumentError, 'image must not be nil' unless image
  @portMappings = (info[:portMappings] || []).map { |e| Marathon::ContainerDockerPortMapping.new(e) }
end

Public Instance Methods

to_pretty_s() click to toggle source
# File lib/marathon/container_docker.rb, line 23
def to_pretty_s
  "#{image}"
end
to_s() click to toggle source
# File lib/marathon/container_docker.rb, line 27
def to_s
  "Marathon::ContainerDocker { :image => #{image} }"
end