[openstack-dev] 答复: [quantum][LBaas] Add members to the pool

Leon Cui lcui at vmware.com
Tue Nov 20 02:26:35 UTC 2012


Hi Youcef,

The problem is “create the member rows” in this call (create a pool)
will insert new members which has only <member_id, pool_id> attributes.
The other mandatory attributes for the member, such as address and port,
are basically None at the end of this call. Do you mean that user has to
update those members by providing those attributes later?



In addition, how do you know the member id (which I suppose it’s
auto-generated) in this call before create the member?



Thanks

Leon

发件人: Youcef Laribi [mailto:Youcef.Laribi at eu.citrix.com]
发送时间: 2012年11月20日 2:51
收件人: Leon Cui
抄送: openstack-dev at lists.openstack.org
主题: RE: [quantum][LBaas] Add members to the pool



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/ed2e9ac0/attachment.html>


More information about the OpenStack-dev mailing list