Sha256: 64201247f70913040ed20a117165f7d8bb7481b2c59975a8f3555a2166acc161

Contents?: true

Size: 587 Bytes

Versions: 32

Compression:

Stored size: 587 Bytes

Contents

module Kontena::Cli::Containers
  class InspectCommand < Clamp::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    parameter "CONTAINER_ID", "Container id"

    def execute
      require_api_url
      token = require_token

      match = container_id.match(/(.+)-(\d+)/)
      if match
        service_name = match[1]
        result = client(token).get("containers/#{current_grid}/#{service_name}/#{container_id}/inspect")
        puts JSON.pretty_generate(result)
      else
        abort("Cannot resolve container service")
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
kontena-cli-0.15.5 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.5.rc2 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.5.rc1 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.4 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.4.rc2 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.4.rc1 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.4.pre1 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.3 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.2 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.1 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.0 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.0.rc3 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.0.rc2 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.15.0.rc1 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.14.7 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.14.6 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.14.5 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.14.4 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.14.3 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.14.2 lib/kontena/cli/containers/inspect_command.rb