Bug 1347786 - API Missing route /organizations/:orgid/repositories to list all repos in an organization
Summary: API Missing route /organizations/:orgid/repositories to list all repos in an ...
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: API
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: Brad Buckingham
QA Contact: Bruno Rocha
URL:
Whiteboard:
Keywords: Triaged
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2016-06-17 15:55 UTC by Peter Vreman
Modified: 2019-04-01 20:27 UTC (History)
4 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2018-02-21 16:49:54 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 15487 None None None 2016-06-21 20:52 UTC

Description Peter Vreman 2016-06-17 15:55:53 UTC
Description of problem:
Missing a route to list all repositories in an organizations. This is inconsistent with other routes like the content_views or products.

[crash] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/katello/api/v2/organizations/3/repositories
<!DOCTYPE html>
<html>
<head>
  <title>The page you were looking for doesn't exist (404)</title>
  <meta name="viewport" content="width=device-width,initial-scale=1">
...

Examples for content_views and products:

[crash] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/katello/api/v2/organizations/3/content_views | jq .total
45
[crash] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/katello/api/v2/organizations/3/products | jq .total
37


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


How reproducible:


Steps to Reproduce:
1. curl "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://localhost/katello/api/v2/organizations/3/repositories

2.
3.

Actual results:
HTTP error

Expected results:
All repositories of the organziation are returned


Additional info:

Comment 2 Brad Buckingham 2016-06-21 20:52:25 UTC
Created redmine issue http://projects.theforeman.org/issues/15487 from this bug

Comment 3 Brad Buckingham 2016-06-21 20:56:40 UTC
Created upstream Katello PR : https://github.com/Katello/katello/pull/6142

Comment 7 Bruno Rocha 2016-11-09 23:18:13 UTC
Verified in:

satellite-6.3.0-6.1.beta.el7sat.noarch - RHEL6 and RHEL7

Conclusion:

Issue is not reproducible.

Test made:


[brocha@localhost ~]$ curl --insecure --user admin:XXX "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XGET https://FQDN/katello/api/v2/organizations/43/repositories | python -m json.tool
{
    "error": null,
    "page": 1,
    "per_page": 9999,
    "results": [
        {
            "content_counts": {
                "docker_manifest": 0,
                "docker_tag": 0,
                "erratum": 5,
                "file": 0,
                "ostree_branch": 0,
                "package": 69,
                "package_group": 1,
                "puppet_module": 0,
                "rpm": 69
            },
            "content_type": "yum",
            "id": 70,
            "label": "Red_Hat_Satellite_Tools_6_2_for_RHEL_7_Server_RPMs_x86_64",
            "last_sync": {
                "ended_at": "2016-11-09 22:25:31 UTC",
                "id": "12bc821b-f4cb-475a-a098-f2d2f8c5e2cd",
                "progress": 1.0,
                "result": "success",
                "started_at": "2016-11-09 22:25:14 UTC",
                "state": "stopped",
                "username": "admin"
            },
            "last_sync_words": "about 1 hour",
            "name": "Red Hat Satellite Tools 6.2 for RHEL 7 Server RPMs x86_64",
            "product": {
                "cp_id": "69",
                "id": 84,
                "name": "Red Hat Enterprise Linux Server",
                "sync_plan": [
                    "name",
                    "description",
                    "sync_date",
                    "interval",
                    "next_sync"
                ]
            },
            "relative_path": "pNecdLxjQ/Library/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6.2/os",
            "url": "https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6.2/os"
        }
    ],
    "search": null,
    "sort": {
        "by": null,
        "order": null
    },
    "subtotal": 1,
    "total": 1
}

Comment 8 Bryan Kearney 2018-02-21 16:43:35 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

Comment 9 pm-sat@redhat.com 2018-02-21 16:49:54 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.