<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML \9884\8BBE\683C\5F0F Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"\6279\6CE8\6846\6587\672C Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:9.0pt;
font-family:SimSun;}
span.HTMLChar
{mso-style-name:"HTML \9884\8BBE\683C\5F0F Char";
mso-style-priority:99;
mso-style-link:"HTML \9884\8BBE\683C\5F0F";
font-family:"Courier New";}
p.HTMLPreformatted, li.HTMLPreformatted, div.HTMLPreformatted
{mso-style-name:"HTML Preformatted";
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.line
{mso-style-name:line;}
span.id
{mso-style-name:id;}
span.number
{mso-style-name:number;}
span.string
{mso-style-name:string;}
span.EmailStyle26
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle27
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#993366;}
span.Char
{mso-style-name:"\6279\6CE8\6846\6587\672C Char";
mso-style-priority:99;
mso-style-link:\6279\6CE8\6846\6587\672C;
font-family:SimSun;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#993366'>Hi Youcef,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'>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?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#993366'>In addition, how do you know the member id (which I suppose it’s auto-generated) in this call before create the member?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#993366'><o:p> </o:p></span></p><div><p class=MsoNormal><span style='color:#993366'>Thanks</span><span style='color:#993366'><o:p></o:p></span></p></div><p class=MsoNormal><span style='color:#993366'>Leon</span><span style='color:#993366'><o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=ZH-CN style='font-size:10.0pt;font-family:SimSun'>发件人</span></b><b><span style='font-size:10.0pt;font-family:SimSun'>:</span></b><span style='font-size:10.0pt;font-family:SimSun'> Youcef Laribi [mailto:Youcef.Laribi@eu.citrix.com] <br><b><span lang=ZH-CN>发送时间</span>:</b> 2012<span lang=ZH-CN>年</span>11<span lang=ZH-CN>月</span>20<span lang=ZH-CN>日</span> 2:51<br><b><span lang=ZH-CN>收件人</span>:</b> Leon Cui<br><b><span lang=ZH-CN>抄送</span>:</b> openstack-dev@lists.openstack.org<br><b><span lang=ZH-CN>主题</span>:</b> RE: [quantum][LBaas] Add members to the pool<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#1F497D'>Hi Leon,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>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).<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>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.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Thanks<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Youcef<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Leon Cui [mailto:lcui@vmware.com] <br><b>Sent:</b> Monday, November 19, 2012 2:34 AM<br><b>To:</b> Youcef Laribi<br><b>Cc:</b> openstack-dev@lists.openstack.org<br><b>Subject:</b> [quantum][LBaas] Add members to the pool<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hi Youcef,<o:p></o:p></p><p class=MsoNormal>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. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Therefore, the sample given in API spec in “Creating a pool” should be corrected as below, where “members” is removed.<o:p></o:p></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>POST /v1.</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#0080C0'>0</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>/pools<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>Host: lbaas-service.cloudX.com:</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#0080C0'>8651</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'><o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>Accept: application/json<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>Content-Type: application/json<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>X-Auth-Token:</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#0080C0'>887665443383838</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'><o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>Content-Length: </span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#0080C0'>194</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'><o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'><o:p> </o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>{<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'> </span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#004080'>"pool"</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'> : {<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'> </span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#004080'>"name"</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>: </span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#004080'>"web_pool"</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>,<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'> </span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#004080'>"vip_id"</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>: </span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#004080'>"db902c0c-d5ff-4753-b465-668ad9656918"</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>,<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'> </span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#004080'>"protocol"</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>: </span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#004080'>"HTTP"</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>,<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'> </span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#004080'>"network_id"</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'> : </span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:#004080'>"e2a7a228-8fd1-4aa8-8d0c-4023a68e1c92"</span><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>,<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#F3F5F7'><span lang=EN style='font-size:10.5pt;font-family:Courier;color:black'>}<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>What do you think? Correct me if I’m wrong.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks<o:p></o:p></p><p class=MsoNormal>Leon<o:p></o:p></p></div></body></html>