[
https://issues.apache.org/jira/browse/QPID-6438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14355563#comment-14355563
]
Rob Godfrey commented on QPID-6438:
-----------------------------------
I don't think there is actually a huge amount of disagreement here...
One might be able to create a queue by either
PUT to /api/latest/queue/<vhostname>/<queuename>
or
POST to /api/latest/queue/<vhostname>
If you do the latter and there is already a queue of the name (given in the
content of the request) we could consider this an error (and thus prevent
people from accidentally updating a queue that had been already been created).
The PUT would always succeed because it would perform an update if the resource
was present, and a create if it was not.
>From the point of view of the UI we probably want to catch an error in the
>case where what the user intended to be a "create" would instead end up an
>update.
So, I think the change Alex is proposing is that we add the ability to use the
POST form as described above, and use this method when attempting to create
objects through the UI. Existing tooling which simply uses PUT would continue
to work.
Am I understanding correctly Alex?
> [Java Broker] Add support for POST method into REST interfaces in order to
> create configured objects via POST
> -------------------------------------------------------------------------------------------------------------
>
> Key: QPID-6438
> URL: https://issues.apache.org/jira/browse/QPID-6438
> Project: Qpid
> Issue Type: Improvement
> Components: Java Broker
> Affects Versions: 0.18, 0.20, 0.22, 0.24, 0.26, 0.28, 0.30, 0.32
> Reporter: Alex Rudyy
> Assignee: Alex Rudyy
> Fix For: 6.0 [Java]
>
>
> PUT method requests are used for both configured object creation and their
> updates. Our REST layer looks for ID or name( coupled with object parent) in
> order to decide whether it is an update request or not.
> Update is made when object with the same id or the same name and parent is
> found. Otherwise a new object is created.
> On creation of new configured objects(for example, virtual host nodes) the
> same name as existing object can be specified by mistake. As result, an
> update request is performed causing updating attributes in existing object
> and saving those attributes in the database. In practice, it might cause
> configuration issues, for instance,
> if user tries to create a new BDB HA VHN and specifies an existing VHN name,
> the existing VHN attributes are updated and on next broker restart a new VHN
> with a new store can be created.
> In many REST best practices it is recommended to use POST requests to create
> REST resources and PUT requests to update/create resources.
> We can use the same approach in the Qpid REST layer, i.e. send POST requests
> if we definitely want to create new objects via web management console or REST
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]