Bug 493111 - errata.delete API for user created errata
Summary: errata.delete API for user created errata
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 530
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Brad Buckingham
QA Contact: Sayli Karmarkar
URL:
Whiteboard:
Depends On:
Blocks: 456996
TreeView+ depends on / blocked
 
Reported: 2009-03-31 16:51 UTC by Sayli Karmarkar
Modified: 2015-03-23 01:09 UTC (History)
2 users (show)

Fixed In Version: sat530
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-10 19:55:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sayli Karmarkar 2009-03-31 16:51:51 UTC
RFE: 

Description of problem:
errata.delete API for user created errata doesn't exist. I think that was an oversight. I think it is important for completion especially when we have create and delete api for all other entities like system, profile, channel etc. 

It would be useful as a cleanup api to customers as well as in our api automation. Otherwise lot of custom errata gets created and never gets deleted.

Comment 1 Brandon Perkins 2009-03-31 16:55:29 UTC
More of an RFE... but I have to believe that this is a trivial addition.  If it turns out to be more than a day of work, then we'll punt it.

Comment 2 Brad Buckingham 2009-03-31 17:02:35 UTC
I agree this is an RFE, but it would be worthwhile addition to the API.  I don't think it will be more than ~1/2 day effort, but will let you know if it is more once I dig in to it.

Comment 3 Brad Buckingham 2009-04-02 17:56:29 UTC
master git commit: aabbd6ec2a24997878f42050998e4852862314dc
vader git commit: ef28b81e4f725f14beefd847f0f51420d7e92ba9

Added the following API to errata namespace:

Method: delete
Description:
Delete an erratum. This method will only allow for deletion of custom errata created either through the UI or API.

Parameters:

    * string sessionKey
    * string advisoryName

Returns:

    * int - 1 on success, exception thrown otherwise. 



While adding this API also observed that APIs setDetails, addPackages and removePackages, from the errata namespace, would allow a user to invoke the method on a RH (non-custom) errata.  Updated those APIs to throw an 'invalid errata' exception when a user attempts to do this.

Comment 4 Sayli Karmarkar 2009-04-08 20:07:41 UTC
verified. Added errata.delete api automation test. Also modified setDetails, addPackages and removePackages to add additional checking for this.

Comment 5 Michael Mráka 2009-08-28 08:28:50 UTC
Verified in stage -> RELEASE_PENDING.

* created errata 'test-1' via webUI
* removed via API:
$ ./xmlrpc-client.pl dell-pem710-01.rhts.eng.bos.redhat.com admin xxx errata.delete test-1
OK
* errata disappeared from webUI, OK
* tried to remove non-existent errata
$ ./xmlrpc-client.pl dell-pem710-01.rhts.eng.bos.redhat.com admin xxx errata.delete asdf
Fault returned from XML RPC Server, fault code -208: redstone.xmlrpc.XmlRpcFault: The errata asdf cannot be found.
* tried to remove errata from RH channel
$ ./xmlrpc-client.pl dell-pem710-01.rhts.eng.bos.redhat.com admin xxx errata.delete RHEA-2009:8822
Fault returned from XML RPC Server, fault code 2600: redstone.xmlrpc.XmlRpcFault: Invalid errata: RHEA-2009:8822

Comment 6 Brandon Perkins 2009-09-10 19:55:17 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html


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