- What's New
- Service Overview
- User Guide
- Template Reference
-
API Reference
- Before You Start
-
API
- Calling APIs
-
Stacks
- Listing Events of a Stack
- Obtaining Stack Metadata
- Listing Stacks
- Creating a Stack
- Obtaining a Stack Template
- Listing Stack Resources
- Listing Stack Outputs
- Continuing to Deploy a Stack
- Deploying a Stack
- Deleting a Stack
- Updating a Stack
- Deleting a Stack with Conditions
- Continuing to Roll Back a Stack
- Execution Plans
- Template Analysis
- Template Management
-
Stack Sets
- Listing Stack Sets
- Creating a Stack Set
- Obtaining a Stack Set Template
- Listing Stack Set Operations
- Obtaining Metadata of a Stack Set
- Listing Stack Instances
- Creating Stack Instances
- Deleting Stack Instance Deprecated
- Updating Stack Instances
- Deleting Stack Instances
- Deploying a Stack Set
- Deleting a Stack Set
- Updating a Stack Set
- Obtaining Metadata of a Stack Set Operation
- Obtaining a Stack Instance
- Customized Providers
- Resource Formation - Hook
- Resource Formation - Module Management
- Permissions and Supported Actions
- Appendix
- Change History
- FAQs
- Videos
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Service Overview
- Getting Started
- Stack Management
- CTS
-
Template Reference
- Template Introduction
-
List of Elements
- Resource Indexes
- AOS.Stack
- CCE.Addon.AutoScaler
- CCE.Cluster
- CCE.HelmRelease
- CCE.NodePool
- CCE.Pod
- CCE.Storage.OBS
- CCE.Storage.SFS
- DCS.Redis
- ECS.CloudServer
- ECS.KeyPair
- NAT.Instance
- NAT.SNatRule
- OBS.Bucket
- RDS.MySQL
- SFS.FileSystem
- ULB.Healthmonitor
- ULB.Listener
- ULB.LoadBalancer
- ULB.Member
- ULB.Pool
- VPC.EIP
- VPC.SecurityGroup
- VPC.SecurityGroupRule
- VPC.Subnet
- VPC.VPC
-
Data Structure
- AOS.BatchItem
- Basic.KeyValuePair
- Basic.Label
- Basic.LabelSelector
- Basic.NameAndSecretValue
- Basic.NameKeyPair
- Basic.NameValuePair
- CCE.Addon.AutoScaler.Node
- CCE.DataVolume
- CCE.HelmChart
- CCE.Labels
- CCE.NodePool
- CCE.PublicIP
- DCS.InstanceBackupPolicy
- DCS.PeriodicalBackupPlan
- ECS.DataVolume
- ECS.EIP
- ECS.ExtendParam
- ECS.MountedVolumes
- ECS.NICS
- ECS.Personality
- ECS.PublicIP
- ECS.RootVolume
- ECS.SecurityGroup
- ECS.ServerTags
- ECS.VolumeExtendParam
- K8S.PodSecurityContext
- K8S.SecurityContext.SeLinuxOptions
- MySQL.DBUser
- MySQL.DataBase
- MySQL.DataStore
- RDS.BackupStrategy
- RDS.HA.Mysql
- RDS.Volume
- ULB.StickySession
- VPC.BandWidth
- VPC.PublicIP
- Appendix
- FAQs
- Change History
-
API Reference (ME-Abu Dhabi Region)
- Before You Start
- API Overview
- Calling APIs
-
API
- Creating a Template
- Querying a Template List
- Updating a Template
- Deleting a Template
- Downloading a Template
- Querying a Template
- Querying the Input Parameters of a Template
- Creating a Stack
- Deleting a Stack
- Executing a Stack Lifecycle
- Querying a Stack List
- Querying a Stack
- Querying a Stack Element List
- Querying a Stack Element
- Querying a Stack Output
- Querying Stack Input
- Querying the Execution Record of a Stack
- Querying a Stack Execution Record List
- Appendix
- Change History
-
API Reference (Kuala Lumpur Region)
- Before You Start
-
API
- Calling APIs
-
Stacks
- Listing Events of a Stack
- Obtaining Stack Metadata
- Listing Stacks
- Creating a Stack
- Obtaining a Stack Template
- Listing Stack Resources
- Listing Stack Outputs
- Continuing to Deploy a Stack
- Deploying a Stack
- Deleting a Stack
- Updating a Stack
- Deleting a Stack with Conditions
- Continuing to Roll Back a Stack
- Execution Plans
- Template Analysis
- Template Management
-
Stack Sets
- Listing Stack Sets
- Creating a Stack Set
- Obtaining a Stack Set Template
- Listing Stack Set Operations
- Obtaining Metadata of a Stack Set
- Listing Stack Instances
- Creating Stack Instances
- Deleting Stack Instance Deprecated
- Updating Stack Instances
- Deploying a Stack Set
- Deleting Stack Instances
- Deleting a Stack Set
- Updating a Stack Set
- Obtaining Metadata of a Stack Set Operation
- Obtaining a Stack Instance
- Appendix
- Change History
- User Guide (Kuala Lumpur Region)
-
User Guide (ME-Abu Dhabi Region)
- General Reference
Copied.
Executing a Stack Lifecycle
Function
This API is used to perform lifecycle operations for a specific stack.
URI
PUT /v2/stacks/{stack_id}/actions
Parameter |
Mandatory |
Description |
---|---|---|
stack_id |
Yes |
Stack ID, which has a length of 1 to 64 characters |
Request
- Request parameters
The request parameters are applicable only to scenarios where the rollback fails.
Table 2 Request parameters Parameter
Mandatory
Type
Description
failure_strategy
No
String
Failure strategy. The default value is DoNothing. The value can be DoNothing or Rollback.
nodes
No
Array of objects
For details about parameters of a stack element lifecycle, see Table 3.
timeout
No
Integer
Lifecycle timeout period (in minutes). The default value is 60 minutes. This value has a length of 0 to 1440 minutes (a maximum of one day, that is, 24 x 60 minutes).
lifecycle
Yes
String
Lifecycle name
The value can be create, delete, upgrade, rollback, or retry.
inputs
No
String
The stack configuration parameters need to be specified during the upgrade. Each key-value structure represents an input and corresponds to the inputs in the template.
template_id
No
String
Uses the new template to execute the lifecycle.
NOTE:
1. Only the inputs upgrade mode is supported during the upgrade.
2. The failure_strategy parameter supports rollback only in the lifecycle of create.
3. The agent, job, DynamicVolume, FlexVolume, DynamicNodePool, NodePool, and AutoScaler elements do not support upgrade or reinstallation upon installation failure.
Table 3 Node parameters Parameter
Mandatory
Type
Description
name
Yes
String
Node name
parameters
No
Object
Node lifecycle parameters, in which ScaleParams parameters (Table 4) are used for the scaling operations.
Table 4 Scaling parameters Parameter
Mandatory
Type
Description
instances
Yes
Integer
Number of nodes. The value ranges from 0 to 100.
NOTE:
Scaling lifecycle is supported only for stateless applications whose number of instances is defined in inputs. If the inputs section is shared by multiple applications, the scale operation is supported only when all these applications are scaled at the same time.
- Creation request example
{ "lifecycle": "create", "timeout": 20, "failure_strategy": "Rollback" }
- Rollback request example
{ "lifecycle": "rollback" }
- Configuration parameter upgrade request example
{ "lifecycle": "upgrade", "inputs": { "param1": "value1" } }
- Retry request example
{ "lifecycle": "retry", "timeout": 20 }
Response
- Response parameters
Table 5 Response parameters Parameter
Type
Description
action_id
String
Execution record ID
last_action_id
String
Record ID of the previous execution
- Example response
{ "action_id" : "string", "last_action_id" : "string", }
Status Code
- Normal
Table 6 Status code Status Code
Description
200
Executing the stack lifecycle is successful.
- Abnormal
Table 7 Status code Status Code
Description
400
The request parameter is incorrect.
404
The stack or the element does not exist.
500
The server fails to process the request due to an unexpected condition.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot