-
Notifications
You must be signed in to change notification settings - Fork 17
/
ACS::ECS::CreateAndAttachDisk.json
151 lines (151 loc) · 3.73 KB
/
ACS::ECS::CreateAndAttachDisk.json
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
{
"FormatVersion": "OOS-2019-06-01",
"Description": {
"name-en": "ACS::ECS::CreateAndAttachDisk",
"name-zh-cn": "创建并将数据盘挂载至ECS实例",
"en": "Creates a disk and attaches a data disk to an ECS instance.",
"zh-cn": "创建一块云盘,并将数据盘挂载到ECS实例上。"
},
"Parameters": {
"regionId": {
"Description": {
"en": "The ID of region",
"zh-cn": "地域ID"
},
"Type": "String",
"Default": "{{ ACS::RegionId }}"
},
"diskName": {
"Description": {
"en": "The name of the disk",
"zh-cn": "云盘名称"
},
"Type": "String"
},
"zoneId": {
"Description": {
"en": "The zone ID that is available in the specified region",
"zh-cn": "在指定的区域内的可用区ID"
},
"Type": "String"
},
"diskCategory": {
"Description": {
"en": "The category of the data disk",
"zh-cn": "数据盘的云盘种类"
},
"Type": "String"
},
"instanceId": {
"Description": {
"en": "The ID of ECS instance",
"zh-cn": "ECS实例ID"
},
"Type": "String",
"MinLength": 1,
"MaxLength": 30
},
"size": {
"Description": {
"en": "The size of the disk",
"zh-cn": "磁盘容量"
},
"Type": "String"
}
},
"Tasks": [
{
"Name": "checkInstanceReady",
"Action": "ACS::CheckFor",
"Description": {
"en": "Checks whether the ECS instance status is Running or Stopped",
"zh-cn": "检测ECS实例是否为运行中或已停止状态"
},
"Properties": {
"Service": "ECS",
"API": "DescribeInstances",
"Parameters": {
"RegionId": "{{ regionId }}",
"InstanceIds": [
"{{ instanceId }}"
]
},
"DesiredValues": [
"Running",
"Stopped"
],
"PropertySelector": "Instances.Instance[].Status"
}
},
{
"Name": "createDisk",
"Action": "ACS::ExecuteAPI",
"Description": {
"en": "Creates a data disk",
"zh-cn": "创建一块数据盘"
},
"Properties": {
"Service": "ECS",
"API": "CreateDisk",
"Parameters": {
"RegionId": "{{ regionId }}",
"DiskCategory": "{{ diskCategory }}",
"DiskName": "{{ diskName }}",
"Size": "{{ size }}",
"ZoneId": "{{ zoneId }}"
}
},
"Outputs": {
"diskId": {
"Type": "String",
"ValueSelector": "DiskId"
}
}
},
{
"Name": "checkForCreatedDiskReady",
"Action": "ACS::CheckFor",
"Description": {
"en": "Checks the disk status Available",
"zh-cn": "检测云盘的状态是否为可用的"
},
"Properties": {
"Service": "ECS",
"API": "DescribeDisks",
"Parameters": {
"RegionId": "{{ regionId }}",
"DiskIds": [
"{{ createDisk.diskId }}"
]
},
"DesiredValues": [
"Available"
],
"PropertySelector": "Disks.Disk[].Status"
}
},
{
"Name": "attachDisk",
"Action": "ACS::ExecuteAPI",
"Description": {
"en": "Attaches a data disk to an ECS instance",
"zh-cn": "将数据盘挂载到ECS实例上"
},
"Properties": {
"Service": "ECS",
"API": "AttachDisk",
"Parameters": {
"RegionId": "{{ regionId }}",
"DiskId": "{{ createDisk.diskId }}",
"InstanceId": "{{ instanceId }}"
}
}
}
],
"Outputs": {
"diskId": {
"Type": "String",
"Value": "{{ createDisk.diskId }}"
}
}
}