• Native OpenStack API

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

Update Stack

Function Description

This interface is used to update a stack.

Interface Format

Method

URI

Description

PUT

/v1/{tenant_id}/stacks/{stack_name}/{stack_id}

Updates a stack.

Request Parameter

Parameter

Type

Mandatory

Description

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

String

No

Timeout (ms)

disable_rollback

Boolean

No

Specifies whether to perform a rollback if the update fails.

Response Parameter

N/A

Request Example

PUT /v1/95d02433133a4c0a87ba6967474a2ad3/stacks/HeatStack/c89c4bb3-96cb-4a55-aafa-076a7939a306
{
    "template": {
        "heat_template_version": "2013-05-23",
        "description": "Create a simple stack",
        "parameters": {
            "flavor": {
                "default": "m1.tiny",
                "type": "string"
            }
        },
        "resources": {
            "hello_world": {
                "type": "OS::Nova::Server",
                "properties": {
                    "key_name": "heat_key",
                    "flavor": {
                        "get_param": "flavor"
                    },
                    "image": "40be8d1a-3eb9-40de-8abd-43237517384f",
                    "user_data": "#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n"
                }
            }
        }
    },
    "parameters": {
        "flavor": "m1.small"
    }
}

Response Example

None

Returned Code

For details, see section Return Code Processing.