Project

General

Profile

Actions

Feature #22389

open

Hammer output should display context akin to the UI Org/Loc switcher

Added by Eric Helms about 6 years ago. Updated almost 5 years ago.

Status:
Ready For Testing
Priority:
High
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

If a user has set a default context, for example wanting to always get data from Acme organization, that should be displayed as part of all output when making hammer requests. This would provide contextual information akin to the UI and help users to understand that the data they are viewing is scoped by context. This can help prevent issues where users expectations for data returned are not met.


Related issues 2 (0 open2 closed)

Related to Hammer CLI - Tracker #2823: Tracker for usability issuesClosed

Actions
Related to Foreman - Feature #27092: Add taxonomies headers for API requestsClosedShira MaximovActions
Actions #1

Updated by Tomáš Strachota about 6 years ago

  • Category set to Hammer core
  • Priority changed from Normal to High
Actions #2

Updated by Tomáš Strachota about 6 years ago

Actions #3

Updated by Tomáš Strachota about 6 years ago

This is an important feature. Eric, do you know if API responses contain the context? I'd expect it in some headers.

It's crucial to add such information especially to output of list commands and to "not found" error messages across the whole CLI.

Actions #4

Updated by Martin Bacovsky about 6 years ago

  • Status changed from New to Assigned
  • Assignee set to Martin Bacovsky
  • Target version set to 246

@eric sorenson would it be acceptable if the information is displayed only in debug mode? I have PR ready to add the current taxonomies to the response headers. The response headers are printed in hammer debug mode. Advantage of this approach is that the taxonomies are displayed for each API subcall we do during the Hammer command execution.

This is what could be seen in the output for each request:

[DEBUG 2018-01-24 12:40:21 API] Response headers: {
                                 :date => "Wed, 24 Jan 2018 12:40:01 GMT",
                               :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
                      :foreman_version => "1.15.6.30",
                  :foreman_api_version => "2",
                 :current_organization => "1; Default Organization",
                     :current_location => "; ANY",
...

If this is okay, no changes in Hammer are needed and I'll switch the component to Foreman/API

Actions #5

Updated by Tomáš Strachota about 6 years ago

Martin, I think we need to display the information on stdout with each info command (and also other commands as I described in my previous comment). This is IMHO to inform users which context they're in.

This feature should use your PR. Can you provide a link, please?

Actions #6

Updated by The Foreman Bot over 5 years ago

  • Status changed from Assigned to New
Actions #7

Updated by Shira Maximov almost 5 years ago

  • Project changed from Hammer CLI to Foreman
  • Category deleted (Hammer core)
  • Triaged set to No
Actions #8

Updated by The Foreman Bot almost 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6851 added
Actions #9

Updated by Ondřej Ezr almost 5 years ago

  • Related to Feature #27092: Add taxonomies headers for API requests added
Actions

Also available in: Atom PDF