[openstack-dev] [quantum][LBaas] Add members to the pool
Youcef Laribi
Youcef.Laribi at eu.citrix.com
Mon Nov 19 18:50:49 UTC 2012
Hi Leon,
You don't have to map the API operations one-to-one to SQLAlchemy operations. For this call (create a pool), you can in SQLAlchemy first create the "pool" row in a pool table, then create the members rows in the member table (and set their pool_id to the pool you created).
If you are worried about updating the DB transactionally, then you can start a transaction before updating both tables and commit it only when both tables have been updated successfully. There will be a lot of operations in the API that will require updating more than one table in the DB, so we have to support transactions anyway.
Thanks
Youcef
From: Leon Cui [mailto:lcui at vmware.com]
Sent: Monday, November 19, 2012 2:34 AM
To: Youcef Laribi
Cc: openstack-dev at lists.openstack.org
Subject: [quantum][LBaas] Add members to the pool
Hi Youcef,
While I'm coding on SQLAlchemy data model for pool, I found that there is no way to create a pool and specifying its members in a single rest call. The members will only be added to a pool by using member creation/update methods.
Therefore, the sample given in API spec in "Creating a pool" should be corrected as below, where "members" is removed.
POST /v1.0/pools
Host: lbaas-service.cloudX.com:8651
Accept: application/json
Content-Type: application/json
X-Auth-Token:887665443383838
Content-Length: 194
{
"pool" : {
"name": "web_pool",
"vip_id": "db902c0c-d5ff-4753-b465-668ad9656918",
"protocol": "HTTP",
"network_id" : "e2a7a228-8fd1-4aa8-8d0c-4023a68e1c92",
}
What do you think? Correct me if I'm wrong.
Thanks
Leon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121119/a294156b/attachment.html>
More information about the OpenStack-dev
mailing list