-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathACS::ECS::DownloadOssFile.json
More file actions
189 lines (189 loc) · 4.72 KB
/
ACS::ECS::DownloadOssFile.json
File metadata and controls
189 lines (189 loc) · 4.72 KB
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
180
181
182
183
184
185
186
187
188
189
{
"FormatVersion": "OOS-2019-06-01",
"Description": {
"name-en": "ACS::ECS::DownloadOssFile",
"name-zh-cn": "下载OSS文件(ECS)",
"en": "Download OSS files",
"zh-cn": "下载OSS文件 (ECS)"
},
"Parameters": {
"regionId": {
"Type": "String",
"Label": {
"en": "RegionId",
"zh-cn": "地域ID"
},
"AssociationProperty": "ALIYUN::ECS::RegionId",
"Default": "{{ ACS::RegionId }}"
},
"ossRegion": {
"Description": {
"en": "The region id of OSS",
"zh-cn": "OSS所在地域"
},
"Label": {
"en": "OSS Region",
"zh-cn": "OSS地域"
},
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::RegionId",
"Default": "{{ ACS::RegionId }}"
},
"bucketName": {
"Label": {
"en": "BucketName",
"zh-cn": "OSS bucket 名称"
},
"Type": "String",
"AssociationProperty": "ALIYUN::OSS::Bucket::BucketName",
"AssociationPropertyMetadata": {
"RegionId": "ossRegion"
}
},
"objectName": {
"Label": {
"en": "ObjectName",
"zh-cn": "OSS object 名称"
},
"Type": "String",
"AssociationProperty": "ALIYUN::OSS::Object::ObjectName",
"AssociationPropertyMetadata": {
"RegionId": "ossRegion",
"BucketName": "bucketName",
"ValueType": "bucketName"
}
},
"validTime": {
"Label": {
"en": "Valid time of OSS file (s)",
"zh-cn": "OSS文件有效期(秒)"
},
"Type": "Number",
"Default": 6000
},
"instanceId": {
"Label": {
"en": "ECSInstanceId",
"zh-cn": "ECS实例ID"
},
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceId",
"AssociationPropertyMetadata": {
"RegionId": "regionId"
}
},
"destinationDir": {
"Label": {
"en": "Destination directory",
"zh-cn": "下载文件路径"
},
"Description": {
"en": "The directory where the file to download to, like /root/dir1/dir2 (linux), C:\\\\Users\\\\Administrator\\\\dir1\\\\dir2 (windows)",
"zh-cn": "文件要下载到的目录,如/root/dir1/dir2 (linux), C:\\\\Users\\\\Administrator\\\\dir1\\\\dir2 (windows)"
},
"Type": "String"
},
"downloadWaitingTime": {
"Label": {
"en": "Waiting time for download (s)",
"zh-cn": "下载等待时间(秒)"
},
"Type": "Number",
"Default": 600
}
},
"Tasks": [
{
"Name": "generateUrl",
"Action": "ACS::ExecuteAPI",
"Description": {
"en": "Generate download url",
"zh-cn": "生成下载链接"
},
"Properties": {
"Service": "OSS",
"API": "GenerateUrl",
"Method": "GET",
"URI": "{{ objectName }}",
"Headers": {
"Content-MD5": "",
"Content-Type": "application/json"
},
"Parameters": {
"BucketName": "{{ bucketName }}",
"RegionId": "{{ ossRegion }}",
"Expires": "{{ validTime }}",
"Internal": {
"Fn::If": [
{
"Fn::Equals": [
"{{ ossRegion }}",
"{{ regionId }}"
]
},
"true",
"false"
]
}
},
"Body": ""
},
"Outputs": {
"temporaryUrl": {
"Type": "String",
"ValueSelector": ".Url"
}
}
},
{
"Name": "downloadFile",
"Action": "ACS::ECS::DownloadFile",
"Description": {
"en": "Download file from OSS",
"zh-cn": "从OSS下载文件"
},
"Properties": {
"regionId": "{{ regionId }}",
"instanceId": "{{ instanceId }}",
"sourceType": "https",
"sourcePath": "{{ generateUrl.temporaryUrl }}",
"destinationDir": "{{ destinationDir }}",
"timeout": "{{ downloadWaitingTime }}"
}
}
],
"Metadata": {
"ALIYUN::OOS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"ossRegion",
"bucketName",
"objectName",
"validTime"
],
"Label": {
"default": {
"zh-cn": "Oss信息",
"en": "Oss Info"
}
}
},
{
"Parameters": [
"regionId",
"instanceId",
"destinationDir",
"downloadWaitingTime"
],
"Label": {
"default": {
"zh-cn": "Ecs信息与下载路径",
"en": "Ecs Info and Download Path"
}
}
}
]
}
}
}