<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>API on Launchpad Blog</title>
    <link>https://blog.launchpad.net/tags/api/</link>
    <description>News and updates from the Launchpad team</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 28 Oct 2025 11:31:12 +0000</lastBuildDate>
    <atom:link href="https://blog.launchpad.net/feed/tags/api/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Make fetch service opt-in</title>
      <link>https://blog.launchpad.net/general/make-fetch-service-opt-in/</link>
      <pubDate>Tue, 28 Oct 2025 11:31:12 +0000</pubDate>
      <dc:creator>Vaishnavi Asawale</dc:creator>
      <guid isPermaLink="false">https://blog.launchpad.net/?p=4492</guid>
      <description>&lt;p&gt;Launchpad Builders do not have direct access to the Internet. To reach external resources, they must acquire an authentication token that allows access to a restricted set of URLs via a proxy. This can either be a custom authenticated builder proxy or the fetch service.&lt;/p&gt;
&lt;p&gt;The fetch service is a custom sophisticated context-aware forward proxy. Whereas the builder proxy allows requests to allowlisted URLs, the fetch service also keeps track of requests and dependencies for a build.&lt;/p&gt;
&lt;p&gt;Users can now opt-in to use the fetch service while building snaps, charms, rocks and sourcecraft packages. You can read more about the fetch service &lt;a href=&#34;https://documentation.ubuntu.com/launchpad/developer/reference/services/fetch-service/&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why is the fetch service important?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To achieve traceability and reproducibility, artifact dependencies retrieved during a build must be identified. The fetch service mediates network access between the build host and the outside world, examining the request protocol, creating a manifest of the downloaded artifacts, and keeping a copy of the artifacts for archival and metadata extraction for each package build.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to use the fetch service?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To be able to use the fetch service, users must opt-in. For snaps, charms, rocks and sourcecraft packages, the &lt;code&gt;use_fetch_service&lt;/code&gt; flag should be set to &lt;code&gt;true&lt;/code&gt; in the API. For snaps and charms, this setting is also available in the &lt;em&gt;Edit Recipe&lt;/em&gt; UI page.&lt;/p&gt;
&lt;p&gt;The fetch service can be run in two modes, &amp;ldquo;strict&amp;rdquo; and &amp;ldquo;permissive&amp;rdquo;, where it defaults to the former. Both modes only allow certain resources and formats, as defined by inspectors which are responsible for inspecting the requests and the various downloads that are made during the build, ensuring that the requests are permitted.&lt;/p&gt;
&lt;p&gt;The &amp;ldquo;strict&amp;rdquo; mode errors out if any restrictions are violated. The &amp;ldquo;permissive&amp;rdquo; mode works similarly, but only logs a warning when encountering any violations. The mode can be configured using the &lt;code&gt;fetch_service_policy&lt;/code&gt; option via the API. For snaps and charms, the mode can also be selected from a dropdown on the &lt;em&gt;Edit Recipe&lt;/em&gt; UI page.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When to use the fetch service?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Use the fetch service when you need to keep track of requests and dependencies for a build, e.g., when you need to verify that the artifacts belong to secure, trusted sources.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Information sharing is now in beta for everyone</title>
      <link>https://blog.launchpad.net/general/information-sharing-is-now-in-beta-for-everyone/</link>
      <pubDate>Tue, 28 Aug 2012 13:18:41 +0000</pubDate>
      <dc:creator>Curtis Hovey</dc:creator>
      <guid isPermaLink="false">https://blog.launchpad.net/?p=3674</guid>
      <description>&lt;p&gt;Launchpad&amp;rsquo;s bug and branch privacy features are being replaced by information sharing that permits project maintainers to share kinds of information with people at the project level. No one needs to manage bug and branch subscriptions to ensure trusted users have access to confidential information.&lt;/p&gt;
&lt;h3 id=&#34;maintainers-can-share-and-unshare-their-project-with-people&#34;&gt;Maintainers can share and unshare their project with people&lt;/h3&gt;
&lt;p&gt;Project maintainers and drivers can see the &amp;ldquo;Sharing&amp;rdquo; link on their project&amp;rsquo;s front page. The page lists every user and team that the project shares with. During the transition period of the beta, you might see many users with &amp;ldquo;Some&amp;rdquo; access to &amp;ldquo;Private Security&amp;rdquo; or &amp;ldquo;Private&amp;rdquo; user information. They have this access because they are subscribed to bugs and branches. Maintainers can unshare with users who do not need access to any confidential information, or just unshare a bug or branch with a user. Maintainers can share share with a team to give them full access to one or more kinds of confidential information.&lt;/p&gt;
&lt;p&gt;I have prepared a video that demonstrates the features (my apologies for the flickering)&lt;/p&gt;
&lt;div style=&#34;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;&#34;&gt;
			&lt;iframe allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen&#34; loading=&#34;eager&#34; referrerpolicy=&#34;strict-origin-when-cross-origin&#34; src=&#34;https://www.youtube.com/embed/Vq6VsKuFY_o?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0&#34; style=&#34;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;&#34; title=&#34;YouTube video&#34;&gt;&lt;/iframe&gt;
		&lt;/div&gt;

&lt;h3 id=&#34;commercial-projects-can-set-bug-and-branch-policies&#34;&gt;Commercial projects can set bug and branch policies&lt;/h3&gt;
&lt;p&gt;Projects with commercial subscriptions can also change bug and branch sharing policies to set the default information type of a bug or branch, and control what types they may be changed to. Maintainers can set policies that ensure that bugs and branches are proprietary, and only proprietary, to ensure confidential information is never disclosed.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://blog.launchpad.net/images/posts/2012/08/sharing-policies.png&#34;&gt;&lt;img src=&#34;https://blog.launchpad.net/images/posts/2012/08/sharing-policies.png&#34; alt=&#34;&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;sharing-can-be-managed-using-api-scripts&#34;&gt;Sharing can be managed using API scripts&lt;/h3&gt;
&lt;p&gt;I maintain many project which have a lot of private bugs and branches. The sharing page lists a lot of people, too many to read quickly. I know most work for my organisation, but I don&amp;rsquo;t even know everyone in my organisation. So I wrote a Launchpad API script that can be run by any project maintainer to share the project with a team, then unshare with the team members. The members still have access to the bugs and branches and their subscriptions still work, but they will lose access to my project when they leave the team. This arrangement makes it very easy to manage who has access to my projects. &lt;a href=&#34;https://blog.launchpad.net/images/external/people.canonical.com/_curtis/share-projects-with-team.py&#34;&gt;share-projects-with-team.py&lt;/a&gt; is run with the name of the team and a list of projects to share with it.&lt;/p&gt;
&lt;p&gt;./share-projects-with-team.py my-team project1 project2&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Beta test: asynchronous PPA package copies</title>
      <link>https://blog.launchpad.net/general/beta-test-asynchronous-ppa-package-copies/</link>
      <pubDate>Wed, 18 Jul 2012 18:12:36 +0000</pubDate>
      <dc:creator>Colin Watson</dc:creator>
      <guid isPermaLink="false">https://blog.launchpad.net/?p=3627</guid>
      <description>&lt;p&gt;The Ubuntu Foundations team has sponsored work on various improvements to Launchpad&amp;rsquo;s archive handling lately, mainly to expose various new facilities on the API where we were previously using privileged scripts.  This has involved cleaning up a substantial amount of old code along the way, and it has become possible to fix some other old bugs as spin-offs.&lt;/p&gt;
&lt;p&gt;One of these old bugs is &amp;ldquo;&lt;a href=&#34;https://bugs.launchpad.net/launchpad/+bug/575450&#34;&gt;Archive:+copy-packages nearly unusable due to timeouts&amp;rdquo;&lt;/a&gt;.  The +copy-packages page allows anyone who can upload to a PPA to instead copy packages from another PPA.  This saves effort, and in the &amp;ldquo;Copy existing binaries&amp;rdquo; mode it can save a substantial amount of build time as well.  For example, the &lt;a href=&#34;https://launchpad.net/~libreoffice&#34;&gt;LibreOffice packaging team&lt;/a&gt; uses this to deliver packages to different sets of users after they have passed various levels of testing.&lt;/p&gt;
&lt;p&gt;Unfortunately, the very cases where this is most useful, namely large and complex packages, are also the cases where it is most likely to break.  Copying large numbers of binary packages involves large numbers of database queries and can quite easily overrun the timeout for a single request to the Launchpad web application.  Doing this for several series at once, a common case which seems reasonable, is proportionally less likely to work.  Various attempts have been made to optimise the database interactions here, but ultimately doing lots of complex synchronous work in time for a single web request is doomed to failure.&lt;/p&gt;
&lt;p&gt;The solution to all this is to copy packages asynchronously.  For some time Launchpad has had the ability to schedule &amp;ldquo;package copy jobs&amp;rdquo; which run very shortly after the request (typically within a minute) but not immediately.  For example, the Ubuntu team uses these when copying new versions of packages from Debian unstable in cases where there are no Ubuntu-specific modifications, and when releasing proposed updates to stable releases for general use after verification.  A similar facility has been present in the code for the +copy-packages page for some time, but not exposed due to various bugs.  We believe that these bugs have been fixed now, and so we would like to start copying packages asynchronously when requested via the web UI.&lt;/p&gt;
&lt;p&gt;We have exposed this to &lt;a href=&#34;https://launchpad.net/~launchpad-beta-testers&#34;&gt;beta testers&lt;/a&gt; first.  The effect is that, if you are a beta tester when you ask for packages to be copied, you will be told something like &amp;ldquo;Requested sync of 2 packages.  Please allow some time for these to be processed.&amp;rdquo;  The processing should normally happen within a minute or two, and you will be able to see it in progress on the +packages page for the target archive.  If it succeeds, the in-progress notification will be removed and you will be able to see the changes in the target archive.  Otherwise, you will see a failure notification along these lines:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://blog.launchpad.net/images/posts/2012/07/ppa-copy-failed1.png&#34;&gt;&lt;img src=&#34;https://blog.launchpad.net/images/posts/2012/07/ppa-copy-failed1.png&#34; alt=&#34;A notification of a failed copy to a PPA.&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If beta-testing goes well, then we will enable this for all users, and remove the old synchronous copying code shortly afterwards; so please do report any problems you see.&lt;/p&gt;
&lt;p&gt;If you are relying on package copies in the web UI happening immediately rather than within a few minutes, firstly, please contact us &lt;strong&gt;(e.g. #launchpad-dev on freenode IRC, or launchpad-users@lists.launchpad.net)&lt;/strong&gt; as we would like to understand your requirements in more detail; secondly, you may be able to use the Archive.syncSource API method instead, which also has timeout constraints but is at least guaranteed to remain synchronous.  However, we hope that most people will not have such a requirement.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Launchpad needs a command line</title>
      <link>https://blog.launchpad.net/clients/launchpad-needs-a-command-line/</link>
      <pubDate>Fri, 18 Mar 2011 08:51:11 +0000</pubDate>
      <dc:creator>Martin Pool</dc:creator>
      <guid isPermaLink="false">https://blog.launchpad.net/?p=2030</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://launchpad.net/&#34;&gt;Launchpad&lt;/a&gt; has a web UI, an &lt;a href=&#34;https://help.launchpad.net/EmailInterface&#34;&gt;email interface&lt;/a&gt;, and a &lt;a href=&#34;https://help.launchpad.net/API&#34;&gt;ReST API&lt;/a&gt; that exposes every object in the database.&lt;/p&gt;
&lt;p&gt;There are also a bunch of &lt;a href=&#34;https://help.launchpad.net/Clients&#34;&gt;client programs&lt;/a&gt;, command line and graphical, that talk to Launchpad to do various things.&lt;/p&gt;
&lt;p&gt;What we don&amp;rsquo;t yet have, and what I think would be great, is a systematic client that lets you manipulate &lt;u&gt;&lt;br&gt;
everything&lt;/u&gt; from the command line.  There&amp;rsquo;s some code that starts towards this in &lt;a href=&#34;https://launchpad.net/hydrazine&#34;&gt;Hydrazine&lt;/a&gt;, &lt;a href=&#34;https://launchpad.net/lptools&#34;&gt;lptools&lt;/a&gt; and others, but I think having just a single tool that eventually does everything would be more discoverable and avoid unnecessary fragmentation or duplication.&lt;/p&gt;
&lt;p&gt;(That&amp;rsquo;s not to say there&amp;rsquo;s not room for others that are guis, that are specialized to particular projects or that encapsulate a lot of policy or opinion about what they&amp;rsquo;re doing.)&lt;/p&gt;
&lt;p&gt;So dobey and I have agreed to gradually merge hydrazine into lptools, and with other people to work towards making lptools cover everything you can do through the web UI or the API.  If you have scripts you&amp;rsquo;ve written yourself, perhaps you&amp;rsquo;d like to merge them in.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>New &#39;web_link&#39; property on API objects</title>
      <link>https://blog.launchpad.net/cool-new-stuff/new-web_link-property/</link>
      <pubDate>Mon, 07 Feb 2011 06:06:46 +0000</pubDate>
      <dc:creator>Martin Pool</dc:creator>
      <guid isPermaLink="false">https://blog.launchpad.net/?p=1916</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://help.launchpad.net/API&#34;&gt;Launchpad has a REST API&lt;/a&gt; that exposes almost every object within Launchpad.  Most of them have API URLs that closely match the human-readable URL: for instance, &lt;a href=&#34;https://bugs.launchpad.net/bugs/316694&#34;&gt;&lt;tt&gt;https://bugs.launchpad.net/bugs/316694&lt;/tt&gt;&lt;/a&gt; can also be obtained in machine-oriented JSON &lt;del datetime=&#34;2011-02-09T04:41:30+00:00&#34;&gt;or XML&lt;/del&gt; form from &lt;a href=&#34;http://api.launchpad.net/1.0/bugs/316694&#34;&gt;&lt;tt&gt;http://api.launchpad.net/1.0/bugs/316694&lt;/tt&gt;&lt;/a&gt;.  (The &amp;ldquo;1.0&amp;rdquo; in that URL means this is in the 1.0 API namespace.)&lt;/p&gt;
&lt;p&gt;Previously, many Launchpadlib clients used string transformation to get from the API URL to something they could show a human in a web browser.&lt;/p&gt;
&lt;p&gt;We&amp;rsquo;ve just &lt;a href=&#34;https://bugs.launchpad.net/launchpad/+bug/316694&#34;&gt;added a &lt;code&gt;web_link&lt;/code&gt; property&lt;/a&gt; on all Launchpad objects, so client applications can (and should) now just use that instead.  Because this is just sent in the object representation you don&amp;rsquo;t need to upgrade launchpadlib to see it.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Three tips for faster launchpadlib api clients</title>
      <link>https://blog.launchpad.net/api/three-tips-for-faster-launchpadlib-api-clients/</link>
      <pubDate>Wed, 14 Jul 2010 13:30:04 +0000</pubDate>
      <dc:creator>Martin Pool</dc:creator>
      <guid isPermaLink="false">https://blog.launchpad.net/?p=1626</guid>
      <description>&lt;p&gt;Three tips from &lt;a href=&#34;http://launchpad.net/~leonardr&#34;&gt;Leonard&amp;rsquo;s&lt;/a&gt; lightning talk in Prague about writing faster &lt;a href=&#34;https://help.launchpad.net/API/launchpadlib#preview&#34;&gt;Launchpadlib&lt;/a&gt; API clients:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Use the latest launchpadlib.&lt;/strong&gt; It gets faster from one release to the next.  (The versions in the current Ubuntu release should be fine; otherwise run from the &lt;a href=&#34;https://code.edge.launchpad.net/~lazr-developers/launchpadlib/trunk&#34;&gt;branch&lt;/a&gt; or the latest &lt;a href=&#34;https://launchpad.net/launchpadlib/+download&#34;&gt;tarball&lt;/a&gt;.)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Profile:&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;    import httplib2
    httplib2.debuglevel = 1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;will show each http request and response, so that you can see what&amp;rsquo;s taking time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Fetch objects only once:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Don&amp;rsquo;t do this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;    if bug.person is not None:
        print bug.person.name
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;instead&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;    p = bug.person
    if p is not None:
        print p.name
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the first case, the client may fetch the Person object twice.  (We may fix this in future.)&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>Anonymous Access to the Launchpad Web Service API</title>
      <link>https://blog.launchpad.net/general/anonymous-access-to-the-launchpad-web-service-api/</link>
      <pubDate>Tue, 19 Jan 2010 14:46:14 +0000</pubDate>
      <dc:creator>Leonard Richardson</dc:creator>
      <guid isPermaLink="false">https://blog.launchpad.net/?p=1279</guid>
      <description>&lt;p&gt;You asked for it and we&amp;rsquo;ve delivered. Your launchpadlib scripts can now get read-only access to &lt;a href=&#34;https://help.launchpad.net/API&#34;&gt;the Launchpad web service API&lt;/a&gt; without going through any authorization process. Previously, to authorize your script, you had to open a web page in the end-user&amp;rsquo;s web browser and get the user to click a button. Now, you only have to go through that process if you want to access someone&amp;rsquo;s private data or modify the Launchpad dataset on their behalf.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re using the latest version of launchpadlib (1.5.4), you can log in anonymously with the &lt;code&gt;login_anonymously&lt;/code&gt; helper method. You just have to pass in a string identifying your client, and the name of the Launchpad server you want to access.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from launchpadlib.launchpad import Launchpad
launchpad = Launchpad.login_anonymously(&amp;#34;my client&amp;#34;, &amp;#34;edge&amp;#34;)
print launchpad.bugs[1].title
# Microsoft has a majority market share&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;(That code also illustrates how the latest version of Launchpadlib lets you specify a short string like &amp;ldquo;edge&amp;rdquo; instead of having to importing a constant like EDGE_SERVICE_ROOT.)&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re using an older version of launchpadlib, you can log in anonymously using the &lt;code&gt;login&lt;/code&gt; helper method. You can get anonymous access by passing in empty strings for the token string and access secret:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;from launchpadlib.launchpad import Launchpad, EDGE_SERVICE_ROOT
launchpad = Launchpad.login(&amp;#34;my client&amp;#34;, &amp;#34;&amp;#34;, &amp;#34;&amp;#34;, EDGE_SERVICE_ROOT)
print launchpad.bugs[1].title
# Microsoft has a majority market share&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Right now, anonymous access only works on Launchpad&amp;rsquo;s &amp;rsquo;edge&amp;rsquo; and &amp;lsquo;staging&amp;rsquo; instances. It&amp;rsquo;ll be installed on production at the end of the month, with the release of Launchpad 10.01.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>
