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
Moving 6.2 bugs out to sat-backlog.
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