thanks<br><br>by compare the doc and the source code, i know the api reference is point to the current stable, which means folsom.<br>there is no mistiness for me. <br>but if there is <a href="http://api.openstack.org/essex/api-ref.html">http://api.openstack.org/essex/api-ref.html</a>, <a href="http://api.openstack.org/folsom/api-ref.html">http://api.openstack.org/folsom/api-ref.html</a>, <a href="http://api.openstack.org/grizzly/api-ref.html">http://api.openstack.org/grizzly/api-ref.html</a> and etc, it will be excellent.<br>
<br>i just read the source code of folsom nova, learn from them and make this extension available in Essex, <br>so i can use networks extension to create and associate(with a little difference)<br>thanks to the contributors<br>
<br><div class="gmail_quote">On Thu, Mar 28, 2013 at 9:18 PM, Anne Gentle <span dir="ltr"><<a href="mailto:annegentle@justwriteclick.com" target="_blank">annegentle@justwriteclick.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto"><div>In Essex this API extension was unavailable. I apologize that the docs site does not currently clarify that. We are working on a solution. In Essex you must use the nova-manage commands to manage networks.<br>
<br>Anne Gentle<div>Content Stacker</div><div><a href="mailto:anne@openstack.org" target="_blank">anne@openstack.org</a></div><div><br></div></div><div><div class="h5"><div><br>On Mar 28, 2013, at 3:46 AM, Ajiva Fan <<a href="mailto:aji.zqfan@gmail.com" target="_blank">aji.zqfan@gmail.com</a>> wrote:<br>
<br></div><blockquote type="cite"><div>hello everyone:<br><br>i have a very simple question which confuses me for a long time:<br>how should i add a network to a project via rest api?<br><br>1) i'm admin of the whole cloud env essex, (i think the folsom is same in this case)<br>
2) using nova-network:vlan (if using flatdhcp, the associate action is meanless)<br>3) a user project "user-project" is created, and the admin:admin is not that project's admin (and even not a member of it)<br>
4) a network "user-network" is created, but not associated with "user-project"<br>5) how to associate the "user-network" with "user-project" ?<br><br>i know i can use "nova-manage" via nova-client in the control node, <br>
but what i need to know is how to do this operation via rest api, like curl or in horizon?<br><br>the rest api is: <a href="http://api.openstack.org/api-ref.html" target="_blank">http://api.openstack.org/api-ref.html</a><br>
<div>
<span>POST</span></div>
<div>v2/{tenant_id}/os-networks/add <br>with a body identifier the network's id<br><br>the problem is that, even i have admin:admin token, i *cannot* associate the "user-network" with "user-project", <br>
because from the source code of folsom(and essex) nova, in the <a href="http://nova.api.openstack.wsgi.py" target="_blank">nova.api.openstack.wsgi.py</a> of line 931, i find this:<br></div><div><span><br>
project_id</span> <span>=</span> <span>action_args</span><span>.</span><span>pop</span><span>(</span><span>"project_id"</span><span>,</span> <span>None</span><span>)</span></div>
<div> <span>context</span> <span>=</span> <span>request</span><span>.</span><span>environ</span><span>.</span><span>get</span><span>(</span><span>'nova.context'</span><span>)</span></div>
<div> <span>if</span> <span>(</span><span>context</span> <span>and</span> <span>project_id</span> <span>and</span> <span>(</span><span>project_id</span> <span>!=</span> <span>context</span><span>.</span><span>project_id</span><span>)):</span></div>
<div> <span>msg</span> <span>=</span> <span>_</span><span>(</span><span>"Malformed request url"</span><span>)</span></div>
<div> <span>return</span> <span>Fault</span><span>(</span><span>webob</span><span>.</span><span>exc</span><span>.</span><span>HTTPBadRequest</span><span>(</span><span>explanation</span><span>=</span><span>msg</span><span>))<br>
<br>since nova.context.project_id is the project admin_id, and the project_id is extract from the url, <br>so the webob.exc is returned.<br><br>please help me, i read a lot, (both document and source code, i just cannot understand or just miss something important)<br>
but still don't know how to do it.<br></span></div><br>ps: i have sent a mail to openstack-dev on mar 8, but no one reply me. is my question nonsense?<br>Note this mail is not the exactly same as previous one since i've more knowledge of it but the main problem is same<br>
</div></blockquote></div></div><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a></span><br>
<span>Post to : <a href="mailto:openstack@lists.launchpad.net" target="_blank">openstack@lists.launchpad.net</a></span><br><span>Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a></span><br>
<span>More help : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a></span><br></div></blockquote></div></blockquote></div><br>