Class: SwarmClusterCliOpe::Models::Task

Inherits:
Base
  • Object
show all
Defined in:
lib/swarm_cluster_cli_ope/models/task.rb

Constant Summary

Constants inherited from Base

Base::IDNotFoundOnObject

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#docker_command, #docker_inspect, #initialize, #mapped_uri_connection

Methods included from LoggerConcern

#logger

Constructor Details

This class inherits a constructor from SwarmClusterCliOpe::Models::Base

Instance Attribute Details

#idString

Returns:

  • (String)


8
9
10
# File 'lib/swarm_cluster_cli_ope/models/task.rb', line 8

def id
  @id
end

#nameString

Returns:

  • (String)


6
7
8
# File 'lib/swarm_cluster_cli_ope/models/task.rb', line 6

def name
  @name
end

#nodeString

Returns nome dell’immagine.

Returns:

  • (String)

    nome dell’immagine



10
11
12
# File 'lib/swarm_cluster_cli_ope/models/task.rb', line 10

def node
  @node
end

Instance Method Details

#containerObject

Estrapola il container dal task



15
16
17
18
19
20
21
22
23
# File 'lib/swarm_cluster_cli_ope/models/task.rb', line 15

def container
  stack_info = docker_inspect

  cmd = Commands::Container.new(connection_uri: cfgs.get_node_by_id(stack_info.NodeID).connection_uri)
  container = cmd.docker_inspect(stack_info.Status["ContainerStatus"]["ContainerID"]).result(object_class: Container).first

  container

end