Ask Your Question
0

Replicate heat stack create command with HTTP / REST API

asked 2016-12-07 03:30:59 -0500

Tori gravatar image

updated 2016-12-15 10:17:05 -0500

zaneb gravatar image

Hi

I currently create my openstack stacks via the HEAT client. I define all VMs in template files and provide a parameter file like so

heat stack-create -f base_stack/base_stack.yaml -e params/sed_other.yaml Base_Stack_42

I need to be able to replicate this client behaviour using HTTP API. That is I will have access to a predefined template description and parameter file and I wish to use them using the Openstack HTTP API. That is, provide the HTTP POST command with a reference to both my pre-defined stack template and parameter file and execute a create stack POST

I note the documentation here Orchestration Service API v1 and the use of files and template_urlfor example and I further note the ask.openstack question here How to pass environment file. However I cannot see how I can use these to call create stack and provide file1 as template description and file2 as parameter file (how can I tell openstack which is which for example?)

Any help or simple example would be greatly appreciated.

edit retag flag offensive close merge delete

Comments

1

Perhaps adding the --debug option to the stack-create command shows you the APIs issued by the heat client.

Bernd Bausch gravatar imageBernd Bausch ( 2016-12-07 18:19:21 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-12-15 10:16:36 -0500

zaneb gravatar image

The main template is passed as template (I recommend you don't use template_url). The environment is passed as environment. Only _other_ files that are referenced by the template or environment are passed in files.

I'm not 100% sure what you mean by "parameter file" - if this is an environment file then you'd pass it as the environment. If it's just parameter values then you'd pass a map of those values as parameters.

edit flag offensive delete link more

Comments

The original poster seems to have thought that the template and environment files are passed to the API in a similar way they are referenced by the CLI client. This is a misconception, of course; no files are referenced in the API request body, but the body simply contains the content of all files.

Bernd Bausch gravatar imageBernd Bausch ( 2016-12-17 00:13:50 -0500 )edit

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: 2016-12-07 03:30:59 -0500

Seen: 371 times

Last updated: Dec 15 '16