Ask Your Question

Revision history [back]

Hi

Use --debug option to get know the REST API structure behind every CLI commands. Refer below one for nova instance create

nova --debug boot --flavor m1.tiny --image cirros --nic net-id=acf5f405-9b56-46c5-9a63-b5871f36f68a --security-group default,jp  testinstance

curl -g -i -X POST http://qaopenstack223.ccs.com:8774/v2/98073903698740af87fb57ca9e41eed5/servers -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}0eee5605668ba803e7f4f52a1140a8ae9a9c5a02" -d '{"server": {"name": "testinstance", "imageRef": "1a210c06-5c8a-4590-b741-57ac63af13a5", "flavorRef": "1", "max_count": 1, "min_count": 1, "networks": [{"uuid": "acf5f405-9b56-46c5-9a63-b5871f36f68a"}], "security_groups": [{"name": "default"}, {"name": "jp"}]}}'

Refer http://docs.python-requests.org/en/latest/user/quickstart/ for python Request module