class Serverspec::Type::DockerNetwork

Public Instance Methods

IPv6_enabled?() click to toggle source

rubocop:disable Naming/MethodName

# File lib/serverspec_extra_types/types/docker_network.rb, line 68
def IPv6_enabled?
  inspection['EnableIPv6']
end
attachable?() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 31
def attachable?
  inspection['Scope']
end
bridge?() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 39
def bridge?
  has_driver? 'bridge'
end
driver() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 43
def driver
  inspection['Driver']
end
exist?() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 85
def exist?
  get_inspection.success?
end
external?() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 77
def external?
  !inspection['Internal']
end
has_driver?(driver) click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 47
def has_driver?(driver)
  self.driver == driver
end
has_label?(label, value = nil) click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 51
def has_label?(label, value = nil)
  if value
    label(label)[1] == value
  else
    label(label)
  end
end
has_scope?(scope) click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 15
def has_scope?(scope)
  self.scope == scope
end
id() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 11
def id
  inspection['Id']
end
ingress?() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 81
def ingress?
  inspection['Ingress']
end
internal?() click to toggle source

rubocop:enable Naming/MethodName

# File lib/serverspec_extra_types/types/docker_network.rb, line 73
def internal?
  inspection['Internal']
end
label(label) click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 59
def label(label)
  labels.find { |key, _val| key == label }
end
labels() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 63
def labels
  inspection['Labels']
end
local_scoped?() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 23
def local_scoped?
  scope == 'local'
end
name() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 7
def name
  inspection['Name']
end
overlay?() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 35
def overlay?
  has_driver? 'overlay'
end
scope() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 19
def scope
  inspection['Scope']
end
swarm_scoped?() click to toggle source
# File lib/serverspec_extra_types/types/docker_network.rb, line 27
def swarm_scoped?
  scope == 'swarm'
end

Private Instance Methods

get_inspection() click to toggle source

rubocop:disable Naming/AccessorMethodName

# File lib/serverspec_extra_types/types/docker_network.rb, line 92
def get_inspection
  @get_inspection ||= @runner.run_command("docker network inspect #{@name}")
end