← Back to team overview

openstack team mailing list archive

Re: [nova-network] add-network-to-project

 

thanks

by compare the doc and the source code, i know the api reference is point
to the current stable, which means folsom.
there is no mistiness for me.
but if there is http://api.openstack.org/essex/api-ref.html,
http://api.openstack.org/folsom/api-ref.html,
http://api.openstack.org/grizzly/api-ref.html and etc, it will be excellent.

i just read the source code of folsom nova, learn from them and make this
extension available in Essex,
so i can use networks extension to create and associate(with a little
difference)
thanks to the contributors

On Thu, Mar 28, 2013 at 9:18 PM, Anne Gentle
<annegentle@xxxxxxxxxxxxxxxxxx>wrote:

> 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.
>
> Anne Gentle
> Content Stacker
> anne@xxxxxxxxxxxxx
>
>
> On Mar 28, 2013, at 3:46 AM, Ajiva Fan <aji.zqfan@xxxxxxxxx> wrote:
>
> hello everyone:
>
> i have a very simple question which confuses me for a long time:
> how should i add a network to a project via rest api?
>
> 1) i'm admin of the whole cloud env essex, (i think the folsom is same in
> this case)
> 2) using nova-network:vlan (if using flatdhcp, the associate action is
> meanless)
> 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)
> 4) a network "user-network" is created, but not associated with
> "user-project"
> 5) how to associate the "user-network" with "user-project" ?
>
> i know i can use "nova-manage" via nova-client in the control node,
> but what i need to know is how to do this operation via rest api, like
> curl or in horizon?
>
> the rest api is: http://api.openstack.org/api-ref.html
> POST
> v2/{tenant_id}/os-networks/add
> with a body identifier the network's id
>
> the problem is that, even i have admin:admin token, i *cannot* associate
> the "user-network" with "user-project",
> because from the source code of folsom(and essex) nova, in the
> nova.api.openstack.wsgi.py of line 931, i find this:
>
>         project_id = action_args.pop("project_id", None)
>         context = request.environ.get('nova.context')
>         if (context and project_id and (project_id != context.project_id
> )):
>             msg = _("Malformed request url")
>             return Fault(webob.exc.HTTPBadRequest(explanation=msg))
>
> since nova.context.project_id is the project admin_id, and the project_id
> is extract from the url,
> so the webob.exc is returned.
>
> please help me, i read a lot, (both document and source code, i just
> cannot understand or just miss something important)
> but still don't know how to do it.
>
> ps: i have sent a mail to openstack-dev on mar 8, but no one reply me. is
> my question nonsense?
> Note this mail is not the exactly same as previous one since i've more
> knowledge of it but the main problem is same
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to     : openstack@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openstack
> More help   : https://help.launchpad.net/ListHelp
>
>

References