Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
The API is inconsistent regrading attaching subscriptions:
1. add_subscriptions in the acitvation keys controller vs the susbcription controller that is generic
2. activation keys controller has add_susbcriptions and remove_subscriptions, but the systems does not have it
3. The wording Add vs Attach
api :POST, "/systems/:system_id/subscriptions", N_("Add a subscription to a system"), :deprecated => true
api :POST, "/activation_keys/:activation_key_id/subscriptions", N_("Add a subscription to an activation key")
api :DELETE, "/systems/:system_id/subscriptions/:id", N_("Unattach a subscription"), :deprecated => true
api :DELETE, "/activation_keys/:activation_key_id/subscriptions/:id", N_("Unattach a subscription")
vs.
api :PUT, "/activation_keys/:id/add_subscriptions", N_("Attach a subscription")
api :PUT, "/activation_keys/:id/remove_subscriptions", N_("Unattach a subscription")
Proposal:
- Remove the add_subscriptions and remove_subscriptions from the activation keys controller. The add_ and remove_ prefixes are inconsistent with other parts of the API. Secondly yt is not available in the systems controller. Third it is not really RESTful with having PUT for adding and deleting
- Change the wording of Add to Attach in the subscriptions controller
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1.
2.
3.
Actual results:
Expected results:
Consistent API for adding subscriptions, see proposal above
Additional info:
Another issue with the DELETE, in the apidoc is lists the the :id shall be part of the URL _and_ it shall also be provided in a subscriptions[] array. this is duplicate information.
DELETE /katello/api/systems/:system_id/subscriptions/:id DEPRECATED
Unattach a subscription
DELETE /katello/api/activation_keys/:activation_key_id/subscriptions/:id
Unattach a subscription
Params
Param name Description
id
optional
Subscription ID
Value: String
system_id
optional
UUID of the system
Value: String
activation_key_id
optional
activation key ID
Value: String
subscriptions
optional
Array of subscriptions to add
Value: Must be an Array of nested elements
subscriptions[id]
optional
Subscription Pool uuid
Value: String
Closing this is now consistent in Sat6.2 with the non-deprecated API calls:
PUT /katello/api/activation_keys/:id/add_subscriptions
PUT /katello/api/activation_keys/:id/remove_subscriptions
PUT /api/hosts/:host_id/subscriptions/remove_subscriptions
PUT /api/hosts/:host_id/subscriptions/add_subscriptions
Description of problem: The API is inconsistent regrading attaching subscriptions: 1. add_subscriptions in the acitvation keys controller vs the susbcription controller that is generic 2. activation keys controller has add_susbcriptions and remove_subscriptions, but the systems does not have it 3. The wording Add vs Attach api :POST, "/systems/:system_id/subscriptions", N_("Add a subscription to a system"), :deprecated => true api :POST, "/activation_keys/:activation_key_id/subscriptions", N_("Add a subscription to an activation key") api :DELETE, "/systems/:system_id/subscriptions/:id", N_("Unattach a subscription"), :deprecated => true api :DELETE, "/activation_keys/:activation_key_id/subscriptions/:id", N_("Unattach a subscription") vs. api :PUT, "/activation_keys/:id/add_subscriptions", N_("Attach a subscription") api :PUT, "/activation_keys/:id/remove_subscriptions", N_("Unattach a subscription") Proposal: - Remove the add_subscriptions and remove_subscriptions from the activation keys controller. The add_ and remove_ prefixes are inconsistent with other parts of the API. Secondly yt is not available in the systems controller. Third it is not really RESTful with having PUT for adding and deleting - Change the wording of Add to Attach in the subscriptions controller Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Consistent API for adding subscriptions, see proposal above Additional info: