Description of problem: In pulpv1, we have the following consumer API for retrieving the list of errata in a set of repositories that are associated with 1 or more consumers: https://fedorahosted.org/pulp/wiki/UGREST-Consumers#Listapplicableerrataforconsumersfromgivensetofrepositories We use this API to allow an admin to see a summary of the errata (using a dashboard) that need to be applied, along with details on which consumers are affected. We need an equivalent api or mechanism to achieve the same in pulpv2. In pulpv2, an API does exist to determine applicability of errata; however, it currently requires that the user provide as an input the list of errata to check for applicability along with criteria, such as consumers. Given that an organization (e.g. tenant) could have many repositories, each with many errata and many consumers, this seems like it could be difficult and costly to use. In each case, the many could be tens, hundreds or thousands, depending on deployment. For reference, the following is the current API available in pulpv2: http://pulp-dev-guide.readthedocs.org/en/latest/rest-api/consumer/applicability.html Version-Release number of selected component (if applicable): pulp-server-2.0.6-0.2.beta.noarch
Fixed as part of applicability api enhancement story.
*** Bug 784634 has been marked as a duplicate of this bug. ***
build: 2.1.0-0.5.alpha
[root@cloud-qe-8 ~]# python consumer_applicability_demo.py Consumer Applicability API Demo Press enter to continue... ------------------------------------------------------------------------ Demo 1 consumer_criteria - {'filters': {'id': {'$in': ['sunflower', 'voyager']}}, 'sort': [['id', 'ascending']]} repo_criteria - {'filters': {'id': {'$in': ['test-repo', 'unbound-repo', 'test_errata']}}} units - {'erratum': [{'id': 'RHBA-2007:0112'}], 'rpm': [{'filename': 'pulp-test-package-0.3.1-1.fc11.x86_64.rpm'}, {'name': 'pulp-dot-2.0-test'}]} Request Body { "units": { "rpm": [ { "filename": "pulp-test-package-0.3.1-1.fc11.x86_64.rpm" }, { "name": "pulp-dot-2.0-test" } ], "erratum": [ { "id": "RHBA-2007:0112" } ] }, "consumer_criteria": { "sort": [ [ "id", "ascending" ] ], "filters": { "id": { "$in": [ "sunflower", "voyager" ] } } }, "repo_criteria": { "filters": { "id": { "$in": [ "test-repo", "unbound-repo", "test_errata" ] } } } } Response Body { "voyager": { "rpm": [], "erratum": [] }, "sunflower": { "rpm": [], "erratum": [] } } Press enter to continue... result - (200, {u'sunflower': {u'erratum': [], u'rpm': []}, u'voyager': {u'erratum': [], u'rpm': []}}) Press enter to continue... ------------------------------------------------------------------------ Demo 2 consumer_criteria - {'filters': {'id': {'$in': ['sunflower']}}, 'sort': [['id', 'ascending']]} repo_criteria - {'filters': {'id': {'$in': ['unbound-repo', 'test_errata']}}} units - {'rpm': [{'filename': 'pulp-test-package-0.3.1-1.fc11.x86_64.rpm'}, {'name': 'pulp-dot-2.0-test'}]} Request Body { "units": { "rpm": [ { "filename": "pulp-test-package-0.3.1-1.fc11.x86_64.rpm" }, { "name": "pulp-dot-2.0-test" } ] }, "consumer_criteria": { "sort": [ [ "id", "ascending" ] ], "filters": { "id": { "$in": [ "sunflower" ] } } }, "repo_criteria": { "filters": { "id": { "$in": [ "unbound-repo", "test_errata" ] } } } } Response Body { "sunflower": { "rpm": [] } } Press enter to continue... result - (200, {u'sunflower': {u'rpm': []}}) Press enter to continue... ------------------------------------------------------------------------ Demo 3 consumer_criteria - {'filters': {'id': {'$in': ['sunflower']}}, 'sort': [['id', 'ascending']]} repo_criteria - {} units - {'erratum': [{'id': 'RHBA-2007:0112'}], 'rpm': [{'filename': 'pulp-test-package-0.3.1-1.fc11.x86_64.rpm'}, {'name': 'pulp-dot-2.0-test'}]} Request Body { "units": { "rpm": [ { "filename": "pulp-test-package-0.3.1-1.fc11.x86_64.rpm" }, { "name": "pulp-dot-2.0-test" } ], "erratum": [ { "id": "RHBA-2007:0112" } ] }, "consumer_criteria": { "sort": [ [ "id", "ascending" ] ], "filters": { "id": { "$in": [ "sunflower" ] } } }, "repo_criteria": {} } Response Body { "sunflower": { "rpm": [], "erratum": [] } } Press enter to continue... result - (200, {u'sunflower': {u'erratum': [], u'rpm': []}}) Press enter to continue... ------------------------------------------------------------------------ Demo 4 consumer_criteria - {'filters': {'id': {'$in': ['sunflower']}}, 'sort': [['id', 'ascending']]} repo_criteria - {} units - {'rpm': []} Request Body { "units": { "rpm": [] }, "consumer_criteria": { "sort": [ [ "id", "ascending" ] ], "filters": { "id": { "$in": [ "sunflower" ] } } }, "repo_criteria": {} } Response Body { "sunflower": { "rpm": [] } } Press enter to continue... result - (200, {u'sunflower': {u'rpm': []}}) Press enter to continue... ------------------------------------------------------------------------ Demo 5 consumer_criteria - {'filters': {'id': {'$in': ['sunflower']}}, 'sort': [['id', 'ascending']]} repo_criteria - None units - None Request Body { "units": null, "consumer_criteria": { "sort": [ [ "id", "ascending" ] ], "filters": { "id": { "$in": [ "sunflower" ] } } }, "repo_criteria": null } Response Body { "sunflower": { "rpm": [], "erratum": [] } } Press enter to continue... result - (200, {u'sunflower': {u'erratum': [], u'rpm': []}}) Press enter to continue... ------------------------------------------------------------------------ Demo 6 consumer_criteria - None repo_criteria - None units - None Request Body { "units": null, "consumer_criteria": null, "repo_criteria": null } Response Body { "voyager": { "rpm": [], "erratum": [] }, "sunflower": { "rpm": [], "erratum": [] } } Press enter to continue... result - (200, {u'sunflower': {u'erratum': [], u'rpm': []}, u'voyager': {u'erratum': [], u'rpm': []}}) Press enter to continue... ------------------------------------------------------------------------ Demo 7 consumer_criteria - {'filters': {'id': {'$in': ['sunflower']}}, 'sort': [['id', 'ascending']]} repo_criteria - {'filters': {'id': {'$in': ['test-repo', 'unbound-repo', 'test_errata']}}} units - {'erratum': [{'id': 'grinder_test_3'}, {'id': 'grinder_test_4'}], 'rpm': [{'filename': 'pulp-test-package-0.3.1-1.fc11.x86_64.rpm'}, {'name': 'pulp-dot-2.0-test'}]} Request Body { "units": { "rpm": [ { "filename": "pulp-test-package-0.3.1-1.fc11.x86_64.rpm" }, { "name": "pulp-dot-2.0-test" } ], "erratum": [ { "id": "grinder_test_3" }, { "id": "grinder_test_4" } ] }, "consumer_criteria": { "sort": [ [ "id", "ascending" ] ], "filters": { "id": { "$in": [ "sunflower" ] } } }, "repo_criteria": { "filters": { "id": { "$in": [ "test-repo", "unbound-repo", "test_errata" ] } } } } Response Body { "sunflower": { "rpm": [], "erratum": [] } } Press enter to continue... result - (200, {u'sunflower': {u'erratum': [], u'rpm': []}}) Press enter to continue...
verify for 2.1
verified 2.1.1 Demo 1 consumer_criteria - {'filters': {'id': {'$in': ['sunflower', 'voyager']}}, 'sort': [['id', 'ascending']]} repo_criteria - {'filters': {'id': {'$in': ['test-repo', 'unbound-repo', 'test_errata']}}} unit_criteria - {'erratum': {'filters': {'id': {'$in': ['RHBA-2007:0112']}}}, 'rpm': {'filters': {'filename': {'$in': ['pulp-test-package-0.3.1-1.fc11.x86_64.rpm']}}}} Request Body { "consumer_criteria": { "sort": [ [ "id", "ascending" ] ], "filters": { "id": { "$in": [ "sunflower", "voyager" ] } } }, "override_config": { "report_style": "by_units" }, "repo_criteria": { "filters": { "id": { "$in": [ "test-repo", "unbound-repo", "test_errata" ] } } }, "unit_criteria": { "rpm": { "filters": { "filename": { "$in": [ "pulp-test-package-0.3.1-1.fc11.x86_64.rpm" ] } } }, "erratum": { "filters": { "id": { "$in": [ "RHBA-2007:0112" ] } } } } } Response Body { "rpm": [ { "details": {}, "summary": { "applicable_consumers": [ "voyager", "sunflower" ], "unit_key": { "name": "pulp-test-package", "checksum": "6bce3f26e1fc0fc52ac996f39c0d0e14fc26fb8077081d5b4dbfb6431b08aa9f", "epoch": "0", "version": "0.3.1", "release": "1.fc11", "arch": "x86_64", "checksumtype": "sha256" } } } ], "erratum": [] }
2.1.1 released