[Yum-devel] restful yum

David Lutterkort dlutter at redhat.com
Sun Dec 4 02:45:42 UTC 2005


On Sat, 2005-12-03 at 01:15 -0500, seth vidal wrote:
> I was reading this page:
>  http://www.xml.com/pub/a/2004/12/01/restful-web.html
> 
> and thinking about how to apply that to the objects yum deals with. This
> is what I've come up with so far:

I understood the REST stuff wrt to methods as saying "It's useful to
restrict actions to a few well-defined methods" rather than that you
should stick to the usual HTTP operations. If the operations in the
problem domain are clearly defined, it becomes easier to map them to a
protocol like HTTP - I don't buy, for example, that defining a PUT on an
installed package as 'remove this package' makes things clearer. The
REST discussion, when talking about methods, brings up similar questions
to OO design: is uninstalling an operation on the local repo that takes
the package as a parameter or the other way round ?
  
> So a uri for a repo would be:
>  http://someplace/repo_identifier
> and a uri for a package could be:
>  http://someplace/repo_identifier/package_identifier
> 
> 
> Does that start to make any sense or am going down the wrong track and
> what can we get out of this?

One thing that would be tremendously useful is defining good URI schemes
for repos and packages - there have been a few discussions lately where
it was necessary to refer to a package, e.g. the discussion about
errata, and I think that the usual way of referencing a package as

        <package pkgid="c463d368340cbafee82dd5d71a3624a49ad225cf" name="pkgname" arch="i386">
      <version epoch="0" ver="1.5" rel="1"/>
   </package>

is a little clumsy; it's also non-constant since the pkgid will change
if the repo owner ever decides to change their hash algorithm. If people
want to attach extra data to a package (e.g., the repo it came from),
they need an identifier for a package that will never change.

I like the idea of identifying a repo by a URI; nice repo maintainers
could put a example yum.conf there. 

For identifying packages in a repo, your suggestion also makes a lot of
sense, except I would split the package identifier into a
'name/arch/epoch:version/release', e.g.
   http://yum-repo.example.com/fc4/glibc/i386/0:2.3.5/10

That automatically gives you URI's for things like 'a specific i386
glibc version from this repo' etc.

David

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20051203/6b492287/attachment.pgp 


More information about the Yum-devel mailing list