Cancel a p3a subscription via the API

Bug #619106 reported by Michael Nelson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

I can't see any way to retrieve and/or cancel a subscription via the API. bug 530315 was created a while ago, and fixed with Person.getArchiveSubscriptionURLs(), and Person.getArchiveSubscriptionURL(archive), and these work well for getting the private PPA url as required.

If, on the other hand, the owner of an archive wants to cancel a subscription via the API I can't see how this can currently be done except when first creating the new subscription. (That is, an ArchiveSubscriber is returned when calling Archive.newSubscription(), but I can't see a way to get a handle on it at a later point... newSubscription() raises an exception if the subscription already exists).

summary: - Cancel a subscription via the API
+ Cancel a p3a subscription via the API
Changed in soyuz:
status: New → Triaged
importance: Undecided → Low
tags: added: software-center
tags: added: api p3a ppa
Revision history for this message
Michael Nelson (michael.nelson) wrote :

I noticed since that I can do this with:
{{{
            subs_uri = lookup_service_root(settings.LP_SERVICE) + (
                "{version}/~{owner_name}/+archive/{ppa_name}/"
                "+subscriptions/{subscriber_name}".format(
                    version=settings.LP_VERSION, owner_name=owner_name,
                    ppa_name=ppa_name,
                    subscriber_name=subscriber_name)
            lp_subscription = self.launchpad_service.load(subs_uri)

            lp_subscription.status = 'Cancelled'
            lp_subscription.lp_save()
}}}

although of course it would be nice to not have to rely on the uri structure.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.