CreateResourceStack
CreateResourceStack
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Request Inputs
Body Fields
paramsObjectRequiredRequest body parameter object.
nameStringRequiredThe resource name.
descriptionStringOptional. The detailed description of the resource.
typeStringOptional. The stack type. Default type: zstack.
rollbackBooleanOptional. Whether to roll back if stack creation fails. By default, rollback is performed on failure.
templateContentStringOptional. The stack content, which is a JSON string.Note: Make sure that at least one of templateContent and templateUuid is not null.
templateUuidStringOptional. The template UUID.Note: Make sure that at least one of templateContent and templateUuid is not null.
parametersStringRequiredThe parameters in the stack. The parameters are JSON strings.
resourceUuidStringOptional. The resource UUID.
systemTagsListOptional. The system tags.
userTagsListOptional. The user tags.
Responses
Endpoint
POST/zstack/v1/cloudformation/stack
/zstack/v1/cloudformation/stack
Request Example
curl -X POST 'http://{host}/zstack/v1/cloudformation/stack' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"name":"<name>","description":"<description>","type":"<type>","rollback":true,"templateContent":"<templateContent>","templateUuid":"<templateUuid>","parameters":"<parameters>","resourceUuid":"<resourceUuid>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
Response Example
200{ "inventory": { "uuid": "d6ad19356c623599a29140e063c18d74", "name": "test", "description": "description", "version": "2018-06-18", "type": "zstack", "templateContent": "{ \"ZStackTemplateFormatVersion\" : \"2018-06-18\", \"Description\": \"Example for create a group vm instance in zstack.\", \"Parameters\" : { \"imageUuid\": { \"Type\" : \"String\", \"Description\": \"Image Uuid, represents the image resource to startup one vm instance\" }, \"instanceOfferingUuid\": { \"Type\": \"String\", \"Description\": \"The instance offering uuid\" }, \"l3NetworkUuid\": { \"Type\": \"String\", \"Description\": \"The l3 network uuid\" }, \"DiskOfferingUuid\": { \"Type\": \"String\", \"Description\": \"DiskOffering for empty disk\" }, \"PrimaryStorageUuid\": { \"Type\": \"String\", \"Description\": \"primarystorage for initial disk\" }, \"HostUuid\": { \"Type\": \"String\", \"Description\": \"host for initial disk\" } }, \"Resources\" : { \"WebServer1\": { \"Type\": \"ZStack::Resource::VmInstance\", \"Properties\": { \"name\" : \"vm\", \"imageUuid\" : {\"Ref\": \"imageUuid\"}, \"instanceOfferingUuid\": {\"Ref\": \"instanceOfferingUuid\"}, \"l3NetworkUuids\": [{\"Ref\": \"l3NetworkUuid\"}] }, \"DeletionPolicy\": \"Retain\" }, \"WebServer2\": { \"Type\": \"ZStack::Resource::VmInstance\", \"Properties\": { \"name\" : \"vm-2\", \"imageUuid\" : {\"Ref\": \"imageUuid\"}, \"instanceOfferingUuid\": {\"Ref\": \"instanceOfferingUuid\"}, \"l3NetworkUuids\": [{\"Ref\": \"l3NetworkUuid\"}] }, \"DependsOn\": [{\"Ref\": \"WebServer1\"}] }, \"EmptyVolume\": { \"Type\": \"ZStack::Resource::DataVolume\", \"Properties\": { \"name\" : \"empty-volume\", \"diskOfferingUuid\": {\"Ref\": \"DiskOfferingUuid\"}, \"primaryStorageUuid\": {\"Ref\": \"PrimaryStorageUuid\"}, \"systemTags\": [{\"Fn::Join\": [\"::\", [\"localStorage\", \"hostUuid\", {\"Ref\": \"HostUuid\"}]]}] }, \"DependsOn\": [{\"Ref\": \"WebServer2\"}] }, \"AttachDataVolumeToVm\": { \"Type\": \"ZStack::Action::AttachDataVolumeToVm\", \"Properties\": { \"vmInstanceUuid\": {\"Fn::GetAtt\" : [\"WebServer1\", \"uuid\"]}, \"volumeUuid\": {\"Fn::GetAtt\" : [\"EmptyVolume\", \"uuid\"]} } } }, \"Outputs\": { \"VmInstance\": { \"Description\" : \"print vm instance\", \"Value\" : {\"Ref\": \"WebServer1\"} } }}", "paramContent": "{ \"imageUuid\": \"8fcfe758a7eb13118d7344a08ff790a5\", \"instanceOfferingUuid\": \"751f662a32184933aff487f5c6e167a6\", \"l3NetworkUuid\": \"1245de5c2d28454bb63e60575ec611cb\", \"DiskOfferingUuid\": \"ad0b4ea4c747401c92a7c990f7375cf1\", \"PrimaryStorageUuid\": \"06c35e7f42264a74abb5b828367169fe\", \"HostUuid\": \"9b57690de23f449e99c8f0da311e568e\"}", "status": "Created", "enableRollback": true } }Change History
This API has no change history records yet.
