set_config APIs
#2333
Replies: 1 comment
-
I have rephrased the discussion a bit in a more neutral manner. In order to keep the In that way, you could add a Of course, that's only relevant if we want to support that use case. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Some time ago, we introduce in storage the
SetConfig
method, exposed asPUT /storage/config
andGET /storage/config
. The storage settings are rather complex so they are not processed by the HTTP layer at all. We might consider them as a document that explains how to create the storage layout.The problem is that we started to, in my opinion, abuse this pattern.
For instance, let's thing about the files API. From an HTTP perspective, I would expect something like:
GET /files
to get the list of files.POST /files
to add a new file.DELETE|PUT /files/:name
to delete or update files.DELETE /files
to clean-up the files.Of course, we do not need all this methods (we can get rid of the
/files/:name
by now). But what we have is:PUT /files/config
which receives the list of files.So if you are using the HTTP API and you want to add a file, you need to retrieve the whole list, add your file and put all of them together again. Sure, we could have a flag to indicate that you just want to add a file but that's exactly the intention behind using
POST
, right?The same happens with the DASD API: we have a set_config method that takes care of everything during the auto-installation. Actually, the logic is implemented in the client while I would have expected it to be in the store. However, this case is slightly different, as we still rely on D-Bus.
What's the problem?
I see two "benefits" for a full
SetConfig
based approach:My proposal
We need to decide the approach we want to follow and be consistent. After all, we are considering our HTTP API as part of our public API.
Let's the discussion begin. 😉
PS: storage is out of discussion.
Beta Was this translation helpful? Give feedback.
All reactions