Feature #22389
openHammer output should display context akin to the UI Org/Loc switcher
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.
Updated by Tomáš Strachota about 7 years ago
- Category set to Hammer core
- Priority changed from Normal to High
Updated by Tomáš Strachota about 7 years ago
- Related to Tracker #2823: Tracker for usability issues added
Updated by Tomáš Strachota about 7 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.
Updated by Martin Bacovsky about 7 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
Updated by Tomáš Strachota about 7 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?
Updated by Shira Maximov over 5 years ago
- Project changed from Hammer CLI to Foreman
- Category deleted (
Hammer core) - Triaged set to No
Updated by The Foreman Bot over 5 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/6851 added
Updated by Ondřej Ezr over 5 years ago
- Related to Feature #27092: Add taxonomies headers for API requests added