Class: DockerEngine::Models::Container::State

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/docker_engine/models/container.rb

Overview

See Also:

Defined Under Namespace

Modules: Status Classes: Health

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(dead: nil, error: nil, exit_code: nil, finished_at: nil, health: nil, oom_killed: nil, paused: nil, pid: nil, restarting: nil, running: nil, started_at: nil, status: nil) ⇒ Object

Some parameter documentations has been truncated, see DockerEngine::Models::Container::State for more details.

ContainerState stores container's running state. It's part of ContainerJSONBase and will be returned by the "inspect" command.

Parameters:

  • dead (Boolean) (defaults to: nil)
  • error (String) (defaults to: nil)
  • exit_code (Integer) (defaults to: nil) —

    The last exit code of this container

  • finished_at (String) (defaults to: nil) —

    The time when this container last exited.

  • health (DockerEngine::Models::Container::State::Health, nil) (defaults to: nil) —

    Health stores information about the container's healthcheck results.

  • oom_killed (Boolean) (defaults to: nil) —

    Whether a process within this container has been killed because it ran

  • paused (Boolean) (defaults to: nil) —

    Whether this container is paused.

  • pid (Integer) (defaults to: nil) —

    The process ID of this container

  • restarting (Boolean) (defaults to: nil) —

    Whether this container is restarting.

  • running (Boolean) (defaults to: nil) —

    Whether this container is running.

  • started_at (String) (defaults to: nil) —

    The time when this container was last started.

  • status (Symbol, DockerEngine::Models::Container::State::Status) (defaults to: nil) —

    String representation of the container state. Can be one of "created",



# File 'lib/docker_engine/models/container.rb', line 2279

Instance Attribute Details

#dead ⇒ Boolean?

Returns:

  • (Boolean, nil)


2201
# File 'lib/docker_engine/models/container.rb', line 2201

optional :dead, DockerEngine::Internal::Type::Boolean, api_name: :Dead

#error ⇒ String?

Returns:

  • (String, nil)


2206
# File 'lib/docker_engine/models/container.rb', line 2206

optional :error, String, api_name: :Error

#exit_code ⇒ Integer?

The last exit code of this container

Returns:

  • (Integer, nil)


2212
# File 'lib/docker_engine/models/container.rb', line 2212

optional :exit_code, Integer, api_name: :ExitCode

#finished_at ⇒ String?

The time when this container last exited.

Returns:

  • (String, nil)


2218
# File 'lib/docker_engine/models/container.rb', line 2218

optional :finished_at, String, api_name: :FinishedAt

#health ⇒ DockerEngine::Models::Container::State::Health?

Health stores information about the container's healthcheck results.



2224
# File 'lib/docker_engine/models/container.rb', line 2224

optional :health, -> { DockerEngine::Container::State::Health }, api_name: :Health, nil?: true

#oom_killed ⇒ Boolean?

Whether a process within this container has been killed because it ran out of memory since the container was last started.

Returns:

  • (Boolean, nil)


2231
# File 'lib/docker_engine/models/container.rb', line 2231

optional :oom_killed, DockerEngine::Internal::Type::Boolean, api_name: :OOMKilled

#paused ⇒ Boolean?

Whether this container is paused.

Returns:

  • (Boolean, nil)


2237
# File 'lib/docker_engine/models/container.rb', line 2237

optional :paused, DockerEngine::Internal::Type::Boolean, api_name: :Paused

#pid ⇒ Integer?

The process ID of this container

Returns:

  • (Integer, nil)


2243
# File 'lib/docker_engine/models/container.rb', line 2243

optional :pid, Integer, api_name: :Pid

#restarting ⇒ Boolean?

Whether this container is restarting.

Returns:

  • (Boolean, nil)


2249
# File 'lib/docker_engine/models/container.rb', line 2249

optional :restarting, DockerEngine::Internal::Type::Boolean, api_name: :Restarting

#running ⇒ Boolean?

Whether this container is running.

Note that a running container can be paused. The Running and Paused booleans are not mutually exclusive:

When pausing a container (on Linux), the freezer cgroup is used to suspend all processes in the container. Freezing the process requires the process to be running. As a result, paused containers are both Running and Paused.

Use the Status field instead to determine if a container's state is "running".

Returns:

  • (Boolean, nil)


2264
# File 'lib/docker_engine/models/container.rb', line 2264

optional :running, DockerEngine::Internal::Type::Boolean, api_name: :Running

#started_at ⇒ String?

The time when this container was last started.

Returns:

  • (String, nil)


2270
# File 'lib/docker_engine/models/container.rb', line 2270

optional :started_at, String, api_name: :StartedAt

#status ⇒ Symbol, ...

String representation of the container state. Can be one of "created", "running", "paused", "restarting", "removing", "exited", or "dead".



2277
# File 'lib/docker_engine/models/container.rb', line 2277

optional :status, enum: -> { DockerEngine::Container::State::Status }, api_name: :Status

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/docker_engine/models/container.rb', line 2415