Ask Your Question
0

create security group

asked 2014-02-03 12:46:36 -0500

akilesh1597 gravatar image

I was trying to use the python-neutronclient for creating security groups and it throws the weird ("NeutronClientException: Unable to find 'security_group' in request body" ) exception. Why is it trying to find a security group when I am trying to create a new one.

the list and get method of the python-neutronclient work well though.

I checked the neutron api documentation and see that it has CRUD methods only for network, subnet and ports. ( https://wiki.openstack.org/wiki/Neutron/APIv2-specification (https://wiki.openstack.org/wiki/Neutr...) )

Now I am really confused about the work-flow. Is neutron responsible for creating security groups or is it nova(create works with python-novaclient except that i do not know how to add rules to the sg).

Can any one tell me which process is responsible for this workflow and what the api is and if there is support for it in any python client.

edit retag flag offensive close merge delete

6 answers

Sort by ยป oldest newest most voted
0

answered 2014-02-03 13:00:45 -0500

You should be able to use either the nova or quantum commands to do this. Can you show us what you typed in and what error you are getting?

edit flag offensive delete link more
0

answered 2014-02-03 14:17:21 -0500

akilesh1597 gravatar image

information on request is provided above.

edit flag offensive delete link more
0

answered 2014-02-04 08:01:51 -0500

akilesh1597 gravatar image

Thanks ZhiQiang Fan, that solved my question.

edit flag offensive delete link more
0

answered 2014-02-03 14:24:25 -0500

Can you show the output of neutron ext-list ; it looks like you might be using a plugin that doesn't have the security_group extension enabled. What plugin are you using.

edit flag offensive delete link more
0

answered 2014-02-03 13:09:11 -0500

akilesh1597 gravatar image

First try: Rest api url : http://neutron-server:9696/v2.0/security-groups/ (http://neutron-server:9696/v2.0/secur...) method : post headers: token, accept and content-typ as usual body: { "tenant_id": "f5213473f7c5476fa3e98da32145a49a", "name": "defaulttest", "description": "default test method" } Response:

Status Code: 404 Not Found
Connection: keep-alive
Content-Length: 52
Content-Type: text/plain; charset=UTF-8
Date: Mon, 03 Feb 2014 07:39:12 GMT

If I alter the url and remove the trailing '/' I get

Response: Status Code: 400 Bad Request Connection: keep-alive Content-Length: 67 Content-Type: application/json; charset=UTF-8 Date: Mon, 03 Feb 2014 07:40:36 GMT

response body:

{
   "NeutronError": "Unable to find 'security_group' in request body"
}

The same error comes from python-neutronclient

edit flag offensive delete link more
0

answered 2014-02-04 02:55:29 -0500

aji-zqfan gravatar image

I think the body is wrong, should be:

{ "security_group":{ "name":"new-webservers", "description":"security group for webservers" } }

see example: http://api.openstack.org/api-ref-networking.html#security_groups (http://api.openstack.org/api-ref-netw...)


ps: you can open the debug option of CLI neutron --debug security-group-create defaulttest to see the detail of http interactive

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-02-03 12:46:36 -0500

Seen: 465 times

Last updated: Feb 04 '14