how to give security group in REST json request to create server
I am trying to create instance from REST client. I want to give security group in json request so that the instance gets created in some specified security group. I didn't find any document regarding this. I have tried giving security_group paramater as
http://10.102.153.51:8774/v2/f24b19b2b81c433ab9598bdb184ff12d/servers?security_group=pehlasg "server": {"name": "teesra", "imageRef": "082aa3ea-26dc-44bd-89db-c540e202bfce", "flavorRef": "42", "key_name": "firstkeypair" } I have tried some other ways also
http://10.102.153.51:8774/v2/f24b19b2b81c433ab9598bdb184ff12d/servers
"server": {"name": "teesra", "imageRef": "082aa3ea-26dc-44bd-89db-c540e202bfce", "flavorRef": "42", "key_name": "firstkeypair", "security_groups": [{"name": "default" } ] }
and
"server": {"name": "teesra", "imageRef": "082aa3ea-26dc-44bd-89db-c540e202bfce", "flavorRef": "42", "key_name": "firstkeypair", "security_group": "default" }
but all this is resulting in some error.
What is the correct way to give security groups(multiple ) in json request?
[edit] : It seems like other parameter, which specifies the network(quantum) is missing. How can I give that? I am not able to deploy instance without giving network if quantum is enabled.
Normally you'd find the answer in the API documentation , but I can't see an example there for the security_groups parameter. I've submitted a bug for that.