Bug 822909 - RFE: delete_packages API
RFE: delete_packages API
Status: CLOSED DEFERRED
Product: Pulp
Classification: Community
Component: z_other (Show other bugs)
Master
Unspecified Unspecified
medium Severity unspecified
: ---
: ---
Assigned To: pulp-bugs
Preethi Thomas
: FutureFeature, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-18 09:27 EDT by Dennis Gregorovic
Modified: 2014-01-23 15:15 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-23 15:15:16 EST
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 Dennis Gregorovic 2012-05-18 09:27:21 EDT
The delete_package API works on a single package.  This causes performance issues if there are many packages to delete.  Please add a delete_packages API.  Here's the code:

diff --git a/src/pulp/server/webservices/controllers/repositories.py b/src/pulp/server/webservices/controllers/repositories.py
index 9caddb9..c7a3b30 100644
--- a/src/pulp/server/webservices/controllers/repositories.py
+++ b/src/pulp/server/webservices/controllers/repositories.py
@@ -1118,6 +1118,7 @@ class RepositoryActions(JSONController):
         'upload',
         'add_package',
         'delete_package',
+        'delete_packages',
         'get_package',
         'add_file',
         'remove_file',
@@ -1442,6 +1443,24 @@ class RepositoryActions(JSONController):
         api.remove_packages(id, data['package'])
         return self.ok(True)
 
+    def delete_packages(self, id):
+        """
+        [[wiki]]
+        title: Delete Packages
+        description: Dis-associates packages from the repository. This does not update metadata; call generate_metadata after this call.
+        method: POST
+        path: /repositories/<id>/delete_packages/
+        permission: EXECUTE
+        success response: 200 OK
+        failure response: 404 Not Found if an id does not match a repository
+        return: true
+        parameters:
+         * package, Package object, packages to delete
+        """
+        data = self.params()
+        api.remove_packages(id, data['packages'])
+        return self.ok(True)
+
     def get_package(self, id):
         """
         @deprecated: use deferred fields: packages with filters instead
Comment 1 Dennis Gregorovic 2014-01-23 15:15:16 EST
Not needed anymore

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