• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Heat
  5. Stacks
  6. Create Stack

Create Stack

Function Description

This interface is used to create a stack. Heat verifies a message at the API level and then parses the template. Then, Heat invokes the API of the target component based on the resource dependency to create a resource.

Interface Format

Method

URI

Description

POST

/v1/{tenant_id}/stacks

Create a stack.

Request Parameter

Parameter

Type

Mandatory

Description

stack_name

String

Yes

Specifies the stack name. The value must meet the regular expression rule (^[a-zA-Z][a-zA-Z0-9_.-]{0,254}$).

template

Json

Yes

Specifies the template. The template content must use the yaml syntax.

template_url

String

No

Specifies the template URL. Users cannot select a template using the URL.

environment

Json

No

Specifies the environment information about the stack.

files

Json

No

Specifies files used in the environment.

parameters

Json

No

Specifies parameter information of the stack.

timeout_mins

Int

No

Specifies the timeout duration.

disable_rollback

Boolean

No

Specifies whether to perform a rollback if the update fails.

Response Parameter

Parameter

Type

Mandatory

Description

id

Uuid-String

Yes

Specifies the stack UUID.

links

List(dict)

Yes

Specifies the stack description.

Request Example

POST v1/95d02433133a4c0a87ba6967474a2ad3/stacks
{
    "stack_name": "HeatStack",
    "template_url": "http://172.10.10.46:8080/template/ec2.template",
    "parameters": {
        "Network": "3f8713b7-8aea-4b0f-a70b-98d4e1d6251f",
        "KeyName": "heat-key", 
        "InstanceType": "m1.tiny", 
        "ImageId": "68e22196-a4aa-4946-85c3-75f4957e667a"
    },
    "timeout_mins": 60
}

Response Example

{"stack": {
   "id": "c89c4bb3-96cb-4a55-aafa-076a7939a306",
   "links": [   {
      "href": "http://172.25.150.29:8004/v1/95d02433133a4c0a87ba6967474a2ad3/stacks/HeatStack/c89c4bb3-96cb-4a55-aafa-076a7939a306",
      "rel": "self"
   }]
}}

Returned Code

See Return Code Processing.