Sha256: 2daed5df33da1c9531e7d04c55c00201113e23f3e6d1dbecb3149d73e7f52682

Contents?: true

Size: 549 Bytes

Versions: 12

Compression:

Stored size: 549 Bytes

Contents

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

    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

12 entries across 12 versions & 1 rubygems

Version Path
kontena-cli-0.11.7 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.11.6 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.11.5 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.11.4 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.11.3 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.11.2 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.11.1 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.11.0 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.10.3 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.10.2 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.10.1 lib/kontena/cli/containers/inspect_command.rb
kontena-cli-0.10.0 lib/kontena/cli/containers/inspect_command.rb