Sha256: 6b2a85c4a7d811080c51a8ff03f878fac2e11797defeb9941ac5e44783538e6b

Contents?: true

Size: 620 Bytes

Versions: 14

Compression:

Stored size: 620 Bytes

Contents

module Kontena::Cli::Grids
  module Common

    ##
    # @param [Hash] grid
    def print_grid(grid)
      puts "#{grid['name']}:"
      puts "  uri: #{settings['server']['url'].sub('http', 'ws')}"
      puts "  token: #{grid['token']}"
      puts "  users: #{grid['user_count']}"
      puts "  nodes: #{grid['node_count']}"
      puts "  services: #{grid['service_count']}"
      puts "  containers: #{grid['container_count']}"
    end

    def grids
      @grids ||= client(require_token).get('grids')
    end

    def find_grid_by_name(name)
      grids['grids'].find {|grid| grid['name'] == name }
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
kontena-cli-0.10.3 lib/kontena/cli/grids/common.rb
kontena-cli-0.10.2 lib/kontena/cli/grids/common.rb
kontena-cli-0.10.1 lib/kontena/cli/grids/common.rb
kontena-cli-0.10.0 lib/kontena/cli/grids/common.rb
kontena-cli-0.9.3 lib/kontena/cli/grids/common.rb
kontena-cli-0.9.2 lib/kontena/cli/grids/common.rb
kontena-cli-0.9.1 lib/kontena/cli/grids/common.rb
kontena-cli-0.9.0 lib/kontena/cli/grids/common.rb
kontena-cli-0.8.4 lib/kontena/cli/grids/common.rb
kontena-cli-0.8.3 lib/kontena/cli/grids/common.rb
kontena-cli-0.8.2 lib/kontena/cli/grids/common.rb
kontena-cli-0.8.1 lib/kontena/cli/grids/common.rb
kontena-cli-0.8.0.1 lib/kontena/cli/grids/common.rb
kontena-cli-0.8.0 lib/kontena/cli/grids/common.rb