Sha256: a24437efac0d232234d9d33e7bcb625988fc8cedb0b0a323de64e7ab0c42a4a4
Contents?: true
Size: 760 Bytes
Versions: 16
Compression:
Stored size: 760 Bytes
Contents
require_relative '../helpers/health_helper' module Kontena::Cli::Nodes class HealthCommand < Kontena::Command include Kontena::Cli::Common include Kontena::Cli::GridOptions include Kontena::Cli::Helpers::HealthHelper parameter "NODE_ID", "Node id" def execute require_api_url require_current_grid token = require_token node = client(token).get("nodes/#{current_grid}/#{node_id}") return show_node_health(node) end # @return [Boolean] true if healthy def show_node_health(node) if node['connected'] puts "#{health_icon(:ok)} Node is online" return true else puts "#{health_icon(:offline)} Node is offline" return false end end end end
Version data entries
16 entries across 16 versions & 1 rubygems