Class: DockerSwarm::Service
- Defined in:
- lib/docker_swarm/models/service.rb
Overview
Represents a Docker Swarm Service
Instance Method Summary collapse
-
#restart ⇒ Boolean
Restarts the service by incrementing ForceUpdate, which causes Docker to recreate all tasks.
Methods included from Concerns::Loggable
Methods included from Concerns::Deletable
Methods included from Concerns::Updatable
Methods included from Concerns::Creatable
Methods inherited from Base
all, #as_json, #assign_attributes, #attributes, defined_attributes, find, #id, #initialize, #method_missing, #payload_for_docker, #persisted?, #reload, resource_name, #respond_to_missing?, root_key, routes, #serializable_hash, where
Methods included from Concerns::Inspectable
Constructor Details
This class inherits a constructor from DockerSwarm::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class DockerSwarm::Base
Instance Method Details
#restart ⇒ Boolean
Restarts the service by incrementing ForceUpdate, which causes Docker to recreate all tasks.
16 17 18 19 |
# File 'lib/docker_swarm/models/service.rb', line 16 def restart current = self.Spec&.dig("TaskTemplate", "ForceUpdate").to_i update(Spec: { TaskTemplate: { ForceUpdate: current + 1 } }) end |