-
Notifications
You must be signed in to change notification settings - Fork 17
/
ACS::ECS::ModifyInstanceChargeType.yml
179 lines (179 loc) · 5.28 KB
/
ACS::ECS::ModifyInstanceChargeType.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
FormatVersion: OOS-2019-06-01
Description:
name-en: ACS::ECS::ModifyInstanceChargeType
name-zh-cn: 修改实例的计费方式
en: Modify instance charge type
zh-cn: 修改实例的计费方式
Parameters:
regionId:
Description:
en: The ID of region
zh-cn: 地域ID
Type: String
Default: '{{ ACS::RegionId }}'
instanceId:
Description:
en: The ID of ECS instance
zh-cn: ECS实例ID
Type: String
instanceChargeType:
Description:
en: The instance ChargeType
zh-cn: 实例的付费方式
Type: String
AllowedValues:
- PostPaid
- PrePaid
Default: PostPaid
period:
Description:
en: The period of the instance
zh-cn: 续费时长,PeriodUnit=Week时,Period取值:1~4,PeriodUnit=Month时,Period取值:1~12,24, 36, 48, 60
Type: Number
periodUnit:
Description:
en: The unit of the renewal period (Period)
zh-cn: 续费时长的时间单位,即参数Period的单位
Type: String
AllowedValues:
- Week
- Month
Default: Month
includeDataDisks:
Description:
en: Specifies whether to change the billing method of all data disks attached to the instance from pay-as-you-go to subscription
zh-cn: 是否将实例挂载的所有按量付费数据盘一起转换为包年包月数据盘
Type: Boolean
Default: false
networkChargeType:
Description:
en: The network ChargeType
zh-cn: 网络计费方式
Type: String
AllowedValues:
- PayByBandwidth
- PayByTraffic
- ""
Default: PayByTraffic
Tasks:
- Name: getInstanceChargeType
Action: 'ACS::ExecuteApi'
Description:
en: Queries ECS instance ChargeType
zh-cn: 获取实例的计费方式
Properties:
Service: ECS
API: DescribeInstances
Parameters:
RegionId: '{{ regionId }}'
InstanceId:
- '{{ instanceId }}'
Outputs:
instanceChargeType:
Type: String
ValueSelector: 'Instances.Instance[].InstanceChargeType'
- Name: checkInstanceChargeType
Action: 'ACS::Choice'
Description:
en: Choose next task by instance ChargeType
zh-cn: 根据实例计费方式选择下一个任务
Properties:
DefaultTask: modifyInstanceChargeType
Choices:
- When:
'Fn::Equals':
- '{{ instanceChargeType }}'
- '{{ getInstanceChargeType.instanceChargeType }}'
NextTask: wetherToModifyInternetChargeType
- Name: modifyInstanceChargeType
Description:
en: Modifies instance charge type
zh-cn: 修改实例付费类型
Action: 'ACS::ExecuteApi'
Properties:
Service: ECS
API: ModifyInstanceChargeType
Parameters:
RegionId: '{{ regionId }}'
InstanceIds:
- '{{ instanceId }}'
InstanceChargeType: '{{ instanceChargeType }}'
Period: '{{ period }}'
PeriodUnit: '{{ periodUnit }}'
IncludeDataDisks: '{{ includeDataDisks }}'
- Name: untilInstanceChargeTypeReady
Action: ACS::WaitFor
Description:
en: Waits for the instances ChargeType ready
zh-cn: 等待实例付费方式修改完成
Properties:
Service: ECS
API: DescribeInstances
Parameters:
RegionId: '{{ regionId }}'
InstanceIds:
- '{{ instanceId }}'
DesiredValues:
- '{{ instanceChargeType }}'
PropertySelector: 'Instances.Instance[].InstanceChargeType'
- Name: wetherToModifyInternetChargeType
Action: 'ACS::Choice'
Description:
en: Choose next task by instance internet ChargeType
zh-cn: 根据实例网络计费方式参数选择是否更改网络计费方式
Properties:
DefaultTask: getInternetChargeType
Choices:
- When:
'Fn::Equals':
- '{{ networkChargeType }}'
- ""
NextTask: 'ACS::END'
- Name: getInternetChargeType
Action: 'ACS::ExecuteApi'
Description:
en: Queries ECS internet ChargeType
zh-cn: 获取实例网络的计费方式
Properties:
Service: ECS
API: DescribeInstances
Parameters:
RegionId: '{{ regionId }}'
InstanceId:
- '{{ instanceId }}'
Outputs:
internetChargeType:
Type: String
ValueSelector: 'Instances.Instance[].InternetChargeType'
- Name: checkInternetChargeType
Action: 'ACS::Choice'
Description:
en: Choose next task by instance internet ChargeType
zh-cn: 根据实例网络计费方式选择下一个任务
Properties:
DefaultTask: pauseTask
Choices:
- When:
'Fn::Equals':
- '{{ networkChargeType }}'
- '{{ getInternetChargeType.internetChargeType }}'
NextTask: 'ACS::END'
- Name: pauseTask
Action: 'ACS::Sleep'
Description:
en: Pause the task
zh-cn: 暂停任务
Properties:
Duration: PT10S
- Name: modifyInternetChargeType
Action: 'ACS::ExecuteAPI'
Description:
en: Modifies the billing method for network usage
zh-cn: 修改网络的计费方式
Properties:
Service: ECS
API: ModifyInstanceNetworkSpec
Parameters:
RegionId: '{{ regionId }}'
InstanceId: '{{ instanceId }}'
NetworkChargeType: '{{ networkChargeType }}'