[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Pulp-list] cds, etc. api


So, what is the general state of the api?

To be blunt, they are a bit of a disaster. There are some technical errors that are discovered when people attempt to use them, such as the web site indicating a PUT while the code enforces a POST.

Even if that information is correct, the APIs are lacking in usefulness. The case you bring up is a perfect example.

Repo updates are a weird beast. Certain fields become "locked" once certain operations take place. For instance, on a new repo you can edit most fields. However, once a sync has taken place, some things can no longer be changed as it would be too complicated to resolve the differences.

Unfortunately, those rules aren't documented in either the user guide nor the API docs.

Would you mind filing a bug for the repo update case you bring up? I'd like to have it tracked that it was reported from a user and so we can align it to a sprint to fix it.

> Is it more or less stable and
> functional, or will there be heavy changes in the near future?

The answer is two-fold.

We're gearing up for a v1.0 release. The Katello project will be using our APIs and may require some changes be made for that 1.0 release. For the most part, the APIs should remain relatively stable for that release.

After that, the APIs are going to drastically change as we refactor the daylights out of Pulp to support non-RPM content. A lot is going to change for that, but that is still months away.

I'm asking because I started to implement things against the API,
however to me it looks like not everything is yet working.

For example the API of a repository:

I can update the name without any problems:

PUT /repositories/<repo_id>/ { 'name': 'new_name' }

But I can for example not update some other fields, like feed_cert, with
the same method. I get the following error:

2011-10-27 12:18:48,377 24100:-1282426000:
pulp.server.webservices.controllers.decorators:ERROR: decorators:52
Traceback (most recent call last):
line 48, in report_error
return method(self, *args, **kwargs)
line 127, in _auth_decorator
value = method(self, *args, **kwargs)
line 335, in PUT
repo = api.update(id, delta)
File "/usr/lib/python2.7/site-packages/pulp/server/api/repo.py", line
683, in update
'update keyword "%s", not-supported' % key
Exception: update keyword "feed_cert", not-supported

Although the documentation [1] states, that I can update "any field of a
Repo object except id"

Also it looks like I can't create a repository via the API by passing
feed_cert, feed_ca & feed_key. They seem to be simply ignored, without
anything logged.

This is with:

$ rpm -qa | grep pulp

Looking into the python code, it looks like you're dealing differently
with various attributes than with standard attributes like `name`.

But to me it is not really clear, where this is documented etc.

Can you shed some light on my (probably) poor understanding of the API
and how things work?

Thank you very much!



Pulp-list mailing list
Pulp-list redhat com

Jay Dobies
RHCE# 805008743336126
Freenode: jdob @ #pulp
http://pulpproject.org | http://blog.pulpproject.org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]