Bug 877060 - pulpv2 - need ability to retrieve list of errata applicable to a consumer
pulpv2 - need ability to retrieve list of errata applicable to a consumer
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: consumers (Show other bugs)
Master
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 2.1.0
Assigned To: Sayli Karmarkar
Preethi Thomas
: Triaged
Depends On:
Blocks: katello-v2-pulp
  Show dependency treegraph
 
Reported: 2012-11-15 10:59 EST by Brad Buckingham
Modified: 2015-03-22 21:11 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-04-08 12:03:28 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Brad Buckingham 2012-11-15 10:59:23 EST
Description of problem:

In pulpv1, we have the following consumer API for retrieving the list of errata associated with a consumer:
https://fedorahosted.org/pulp/wiki/UGREST-Consumers#ConsumerErrata

We use this API to allow an admin to view a list of errata that are applicable to a consumer, view the details of each erratum and then use it as an input to initiate an install of selected errata from the server to the consumer.

We need an equivalent api or mechanism to achieve the same in pulpv2.

In pulpv2, an API does exist to determine applicability; however, it currently requires that the user provide as an input the list of errata to check for applicability.  This could be too costly or difficult to use for many consumers.  For example, we could have a RHEL consumer that is associated with a repo that has 1000+ errata, so it isn't really optimal to supply those errata in the input when pulp is already aware of the repositories that are bound to the consumer.

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
Comment 1 Sayli Karmarkar 2013-02-05 04:14:33 EST
Fixed as part of applicability api enhancement story.
Comment 2 Jeff Ortel 2013-02-12 16:02:12 EST
build: 2.1.0-0.5.alpha
Comment 3 Preethi Thomas 2013-04-01 08:43:44 EDT
verified

[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": {}, 
  "sunflower": {}
}
Press enter to continue...

result -
(200, {u'sunflower': {}, u'voyager': {}})

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": {}
}
Press enter to continue...

result -
(200, {u'sunflower': {}})

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": {}
}
Press enter to continue...

result -
(200, {u'sunflower': {}})

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": {}
}
Press enter to continue...

result -
(200, {u'sunflower': {}})

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": {}
}
Press enter to continue...

result -
(200, {u'sunflower': {}})

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": {}, 
  "sunflower": {}
}
Press enter to continue...

result -
(200, {u'sunflower': {}, u'voyager': {}})

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": {}
}
Press enter to continue...

result -
(200, {u'sunflower': {}})

Press enter to continue...

[root@cloud-qe-8 ~]#
Comment 4 Preethi Thomas 2013-04-08 12:03:28 EDT
Pulp 2.1 released 


http://www.pulpproject.org/2013/04/05/pulp-2-1-0-released/

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