Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    How to delete packages with the ProGet REST API?

    Scheduled Pinned Locked Moved Support
    13 Posts 8 Posters 70 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • nik.reiman_6009N Offline
      nik.reiman_6009
      last edited by

      I cannot find any way to delete individual packages with the ProGet REST API, or am I mistaken?

      The problem is, ProGet's retention policies are too limited for our use-case and we will need to write something ourselves. But it only seems that we can delete an entire feed with the API, and not individual packages (or groups). Is it really not possible to delete a group or individual package from the API?

      1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer
        last edited by

        Hello, you can definitely delete packages form the API!

        But please note, from the API Docs page:

        API for Third-party Packages and Feed Types

        In order to support third-party package formats types like NuGet, npm, etc., ProGet implements a variety of third-party APIs. We only provide minimal documentation for these APIs, as they are generally either already documented elsewhere. However, you can generally find the basics by searching for specific things you'd like to do with the API, such as "how to search for packages using the NuGet API" or "how to publish an npm package using the API".

        nik.reiman_6009N 1 Reply Last reply Reply Quote 0
        • nik.reiman_6009N Offline
          nik.reiman_6009 @atripp
          last edited by

          @atripp I must be missing something obvious then. Can you please point me to the API documentation which covers deleting packages? In https://docs.inedo.com/docs/proget/reference/api, I see only:

          • Package Promotion API - does not cover deletion
          • Webhook Management API - not relevant
          • Asset Directory API - not relevant
          • Feed Management API - only covers deleting entire feeds, not packages
          • Connector Health API - not relevant
          • Package Deployment API - only covers deploying packages, not deleting them
          • Security Management API - not relevant
          1 Reply Last reply Reply Quote 0
          • K Offline
            kvasudevan_8753
            last edited by

            To delete a package using curl:

            curl -kL -v -X DELETE -u Admin:<pass> http://<api endpoint url>/package/<package_name>/<package_version>

            you can get the api endpoint url from the feed settings. top right hand corner.

            1 Reply Last reply Reply Quote 1
            • atrippA Offline
              atripp inedo-engineer
              last edited by

              Thanks @kvasudevan_8753 - that definitely will do it :)

              @nik-reiman_6009 package interaction is done through the package-specific, third-party apis; we only provide minimal documentation for these APIs, as they are generally either already documented elsewhere. We simply implement those API.

              So in this case, if you search for how to delete a nuget package from the api, the first result is from Microsoft which details how to Push and Delete packages from a NuGet API

              1 Reply Last reply Reply Quote 0
              • MaxCasconeM Offline
                MaxCascone
                last edited by

                Dropping late here, but I've just asked a similar question in this thread, it may be of use to anyone who stumbles in here: https://forums.inedo.com/topic/3318/proget-delete-all-versions-of-a-package-via-api

                1 Reply Last reply Reply Quote 0
                • J Offline
                  jim.borden_4965
                  last edited by

                  Can anyone confirm that this works for maven packages? I'm going insane trying to figure out how to delete maven packages programatically like I can with NuGet. DELETE requests are outright rejected with the following message:

                  Only GET, HEAD, and PUT are supported for this URL.

                  Is there any way to delete a maven package without going through one by one the entries in all feeds and clicking on delete artifact, then confirming YES?

                  NanciCaloN 1 Reply Last reply Reply Quote 0
                  • NanciCaloN Offline
                    NanciCalo inedo-engineer @jim.borden_4965
                    last edited by

                    Hi @jim-borden_4965 ,

                    The Maven API doesn't support artifact deletion, and we haven't had any requests for that to date. I suppose, usually because it's pretty rare to need to delete a package :)

                    In general, users configure automatic retention rules to delete older things.

                    From a UI-perspective, there is the "bulk package deletion" that's available in ProGet 2022 and later, and so that might save a bunch of clicks.

                    Cheers,
                    Nanci

                    1 Reply Last reply Reply Quote 0
                    • B Offline
                      blake.meike_5923
                      last edited by

                      Hey @NanciCalo,

                      I'm working with Jim Borden on this. We are maintaining a local maven cache which, unlike a full-on public maven server, should be able to delete stuff.

                      We are finding it particularly confusing since, using the API, we, absolutely, can delete packages. It is pretty annoying, though, to have to do it, clicking twice, for each package we want to delete. Surely there must be some way to do it programmatically?

                      Can you point me at the "bulk package deletion"? That might be just the ticket!!

                      Thanks
                      Blake Meike

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        jim.borden_4965
                        last edited by

                        To add a bit more detail, we are basically trying to do our own retention with the free version where actual retention rules are not available. This is easy enough with NuGet, and I have a script that keeps things tidy. We are hosting CI builds inside and we don't need the entire history of the world inside. Same with maven. I have gotten to the point of being able to enumerate package versions with maven via its metadata, but there is simply no programmatic way to delete them it seems (despite the UI allowing it).

                        atrippA 1 Reply Last reply Reply Quote 0
                        • atrippA Offline
                          atripp inedo-engineer @jim.borden_4965
                          last edited by

                          Hi @blake-meike_5923, hi @jim-borden_4965 ,

                          The "bulk delete" is in ProGet 2022 - you just navigate to "Packages", click "bulk edit", and select the ones you wish to delete.

                          Otherwise we haven't implemented a DELETE endpoint for Maven artifacts, so it's not going to be possible programmatically until we do. Unlike the NuGet client, the Maven client doesn't have any delete capabilities and no one else has asked for a custom API endpoint.

                          In ProGet 2023, we do intend on making an API that would work across all package types, but that's a whiles off. We can consider adding and documenting a custom Maven DELETE endpoint, but the use case of "working-around a paid feature" isn't exactly a big motivation for us to prioritize a change 😏

                          Cheers,
                          Alana

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            jim.borden_4965
                            last edited by

                            I understand the lack of motivation for our case, certainly. An API that works across all packages types would probably be even better than a maven specific one. On one final side note, though, is it normal for the delete button in the UI to leave the actual backing files intact? I am noticing that is what happens. The entry disappears from the feed but the files are left on the system.

                            stevedennisS 1 Reply Last reply Reply Quote 0
                            • stevedennisS Offline
                              stevedennis inedo-engineer @jim.borden_4965
                              last edited by

                              @jim-borden_4965 that doesn't sound right; can you create a new forum post (don't want to clutter this anymore) with some more details/etc, and then we can reply/investigate. Thanks 👍

                              1 Reply Last reply Reply Quote 0

                              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                              With your input, this post could be even better 💗

                              Register Login
                              • 1 / 1
                              • First post
                                Last post
                              Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation