forked from aliyun/oos-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathACS::ECS::ModifyPrepaySpec.yml
96 lines (96 loc) · 2.5 KB
/
ACS::ECS::ModifyPrepaySpec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
FormatVersion: OOS-2019-06-01
Description: Changes the type of your subscription instance. The new instance type
will take effect for the entire lifecycle of the instance.
Parameters:
regionId:
Description: The ID of region.
Type: String
Default: '{{ ACS::RegionId }}'
autoPay:
Description: The pay type you will modify.
Type: String
instanceId:
Description: The instance ID you will handle.
Type: String
MinLength: 1
MaxLength: 30
instanceType:
Description: The Instance type you will modify.
Type: String
operatorType:
Description: The operation type.
Type: String
AllowedValues:
- downgrade
- upgrade
Default: upgrade
Tasks:
- Name: stopInstance
Action: ACS::ExecuteAPI
Description: Stops instance with specified instance ID.
Properties:
Service: ECS
API: StopInstance
Parameters:
RegionId: '{{ regionId }}'
InstanceId: '{{ instanceId }}'
- Name: untilInstanceReady
Action: ACS::WaitFor
Description: Waits for the ECS instance to enter stopped status.
Properties:
Service: ECS
API: DescribeInstances
Parameters:
RegionId: '{{ regionId }}'
InstanceIds:
- '{{ instanceId }}'
DesiredValues:
- Stopped
PropertySelector: Instances.Instance[].Status
- Name: modifyPrepayInstanceSpec
Action: ACS::ExecuteAPI
Description: Changes the type of your subscription instance.
Properties:
Service: ECS
API: ModifyPrepayInstanceSpec
Parameters:
RegionId: '{{ regionId }}'
AutoPay: '{{ autoPay }}'
InstanceId: '{{ instanceId }}'
InstanceType: '{{ instanceType }}'
OperatorType: '{{ operatorType }}'
Outputs:
orderId:
Type: List
ValueSelector: OrderId
- Name: waitInstanceReady
Action: ACS::Sleep
Description: Waits the instance recover.
Properties:
Duration: PT1M
- Name: startInstance
Action: ACS::ExecuteAPI
Description: Starts an ECS instance.
Properties:
Service: ECS
API: StartInstance
Parameters:
RegionId: '{{ regionId }}'
InstanceId: '{{ instanceId }}'
- Name: untilStartInstanceReady
Action: ACS::WaitFor
Description: Waits for the ECS instance to enter running status.
Properties:
Service: ECS
API: DescribeInstances
Parameters:
RegionId: '{{ regionId }}'
InstanceIds:
- '{{ instanceId }}'
DesiredValues:
- Running
PropertySelector: Instances.Instance[].Status
Outputs:
orderId:
Type: String
Value: '{{ modifyPrepayInstanceSpec.orderId }}'