Ask Your Question
0

how to pass the template url in curl command for stack creation. [closed]

asked 2016-08-24 01:53:27 -0500

updated 2016-08-24 02:00:42 -0500

I am creating a stack using below curl command and it will successfully created-

curl -s http://<controller_ip>:8004/v1/<tenant_id>/stacks \
-H "X-Auth-Token: "<token_id>"" \
-H "User-Agent: python-heatclient" \
-H "Content-type":"application/json" \
-H "Accept: application/json" \
-d '{"files": {}, "disable_rollback": true, "parameters": {}, "stack_name": "test", "environment": {}, "template": {"heat_template_version": "2015-10-15", "description": "Simple template to deploy a single compute instance", "parameters": null, "resources": {"myport": {"type": "OS::Neutron::Port", "properties": {"network_id": "<net_id>", "fixed_ips": [{"subnet": "<subnet_name>", "ip_address": "<ip_address>"}], "name": "<port_name>"}}}}}' \
 | python -m json.tool

but i want to specify the template_url instead of mentioning complete template in the curl command. Anyone has idea about it how to specify the template url i.e. test.yaml

When i'm going to try with template_url parameters it will throw an error "Bad Request"

curl -s http://<controller_ip>:8004/v1/<tenant_id>/stacks \
-H "X-Auth-Token: "<token_id>"" \
-H "User-Agent: python-heatclient" \
-H "Content-type":"application/json" \
-H "Accept: application/json" \
-d '{"files": {}, "disable_rollback": true, "parameters": {}, "stack_name": "test", "environment": {}, "template_url": "test.yaml" }' \
 | python -m json.tool
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by IRSHAD
close date 2016-08-24 03:34:08.785485

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-08-24 03:33:39 -0500

finally got it: template file should be placed in below path: /var/www/html/

curl -s http://<controller_ip>:8004/v1/<tenant_id>/stacks \
-H "X-Auth-Token: "<token_id>"" \
-H "User-Agent: python-heatclient" \
-H "Content-type":"application/json" \
-H "Accept: application/json" \
-d '{"files": {}, "disable_rollback": true, "parameters": {}, "stack_name": "test", "environment": {}, "template_url": "http://<controller_ip>/test.yaml" }' \
 | python -m json.tool
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-08-24 01:53:27 -0500

Seen: 837 times

Last updated: Aug 24 '16