[Pulp-list] Package.id switched to UUID

Mike McCune mmccune at redhat.com
Mon Jun 14 23:56:12 UTC 2010

I pointed out to jortel in this irc conversation:


that when fetching a package with the REST api based on the package's ID 
the query looks like:

   GET /packages/(u'test_consumerwithpackage', u'1', u'1.2.3', u'1.el5', 

which is exceedingly nasty and hard as a caller to know what the heck to 

To that end I'm going to switch from this type of ID for Package objects:

-        self._id = str((name, epoch, version, release, arch, checksum))
+        self._id = str(uuid.uuid4())

I'm actually considering switching all our objects to use UUIDs for 
their primary keys.  This means any object could be found with:


which looks like:

GET /packages/1c8838f0-be76-4b62-a0cf-c450a5d618e2/

you can still get packages matching by doing:

GET /packages/?name=some-name&arch=i386

which will also find all matching packages with the params specified.

Mike McCune
mmccune AT redhat.com
Red Hat Engineering       | Portland, OR
Systems Management        | 650.254.4248

More information about the Pulp-list mailing list