Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1492832 - Hammer CLI has not option to list repository content
Summary: Hammer CLI has not option to list repository content
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Andrew Kofink
QA Contact: Renzo Nuccitelli
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-18 17:21 UTC by Renzo Nuccitelli
Modified: 2019-08-12 14:07 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 17:00:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 21142 0 Normal Closed Hammer CLI has not option to list File repository content 2020-07-19 07:00:04 UTC

Description Renzo Nuccitelli 2017-09-18 17:21:56 UTC
Description of problem:

Missing feature on Support Arbitrary Files within Content Views.

Hammer has 2 commands to respective add and remove fiels to/from a Repository of type file:

1) hammer repository upload-content
2) hammer repository remove-content

For the second one there is a parameter called "ids" where a list of ids of content to be removed can be provided. Besides that there is no way to query a repository for its contents.
The command "hammer repository --id=repo_id" returns no content and has no option to include these data. Thus the user can not rely entirely on CLI to automate tasks.


Version-Release number of selected component (if applicable):


Satellite 6.3 snap 15.


How reproducible:

Always

Steps to Reproduce:
1. Create a product
2. Attach a repository of type file to it
3. Upload a file to repository
4. Run command hammer repository --id=repo_id

Actual results:

No way of access repository content data, specifically their ids. 

Expected results:

A way of access repository content data.


Additional info:

On API doc at path /api/v2 there is also no documented endpoint to access repository content data. Besides that content can be queried on api/v2/files?repository_id=query_id.

Comment 2 Brad Buckingham 2017-09-27 17:03:28 UTC
Created redmine issue http://projects.theforeman.org/issues/21142 from this bug

Comment 3 Satellite Program 2017-10-06 18:22:55 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21142 has been resolved.

Comment 4 Renzo Nuccitelli 2017-10-16 14:46:06 UTC
I've read the PR but were not able to realize what command should I use to get file content. I've tried the info but still it has no info about the content:

hammer> repository info --id=1
ID:                 1
Name:               file-repo
Label:              file-repo
Organization:       Default Organization
Red Hat Repository: no
Content Type:       file
Mirror on Sync:     yes
URL:                
Publish Via HTTP:   yes
Published At:       http://some.sat.host/isos/919c22dc-a130-4b01-a256-d2825978d1d4/
Relative Path:      Default_Organization/Library/custom/file-product/file-repo
Download Policy:    
Product:            
    ID:   1
    Name: file-product
GPG Key:            

Sync:               
    Status: Not Synced
Created:            2017/10/16 14:33:25
Updated:            2017/10/16 14:33:28
Content Counts:


I have also ran hammer repository --help to check if a new command was added, but there is no new command. So could an example of how to use this command be provided?

Comment 5 Andrew Kofink 2017-10-16 15:46:19 UTC
$ hammer file list --repository-id 5
---|----------------|---------------
ID | NAME           | PATH          
---|----------------|---------------
5  | bar.txt        | bar.txt       
1  | NCC-170115.xml | NCC-170115.xml
---|----------------|---------------

Comment 6 Renzo Nuccitelli 2017-10-17 17:02:45 UTC
The command is not available on last sat 6.3 release:

[root@ ~]# rpm -q satellite
satellite-6.3.0-20.0.beta.el7sat.noarch
[root@ ~]# hammer file
Error: No such sub-command 'file'

Is it possible that we didn't cherry pick this change to last compose?

Comment 7 Andrew Kofink 2017-10-17 17:08:27 UTC
The hammer component didn't make it into snap 20. I'm moving it to MODIFIED so it can make it into the next snap.

Comment 8 Renzo Nuccitelli 2017-10-25 12:13:14 UTC
Command worked on satellite 6.3.0 snap 21:

hammer> file list --repository-id 4
---|-----------------------|----------------------
ID | NAME                  | PATH                 
---|-----------------------|----------------------
1  | zoo_custom_gpgkey.txt | zoo_custom_gpgkey.txt
---|-----------------------|----------------------

Moving this BZ to verified

Comment 9 Bryan Kearney 2018-02-21 17:00:37 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336


Note You need to log in before you can comment on or make changes to this bug.