-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathACS::ECI::ExecContainerCommand.yml
70 lines (70 loc) · 1.79 KB
/
ACS::ECI::ExecContainerCommand.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
FormatVersion: OOS-2019-06-01
Description:
name-en: ACS::ECI::ExecContainerCommand
name-zh-cn: 到ECI容器中执行命令
en: Exec container command
zh-cn: 到ECI容器中执行命令
Parameters:
RegionId:
Label:
en: RegionId
zh-cn: 地域ID
Type: String
AssociationProperty: ALIYUN::ECS::RegionId
Default: '{{ ACS::RegionId }}'
ContainerGroupId:
Label:
en: ECIContainerGroupId
zh-cn: ECI实例ID
Type: String
Command:
Label:
en: CommandList
zh-cn: 命令序列
Type: List
Tasks:
- Name: GetContainer
Description:
en: Get container
zh-cn: 获取ECS实例
Action: ACS::ExecuteApi
Properties:
Service: ECI
API: DescribeContainerGroups
Parameters:
RegionId: '{{ RegionId }}'
ContainerGroupIds:
- '{{ ContainerGroupId }}'
Status: Running
Outputs:
ContainerNames:
Type: List
ValueSelector: .ContainerGroups[].Containers[] | select(.CurrentState.State == "Running") | .Name
- Name: ExecContainerCommand
Action: ACS::ExecuteAPI
Description:
en: Execute container command
zh-cn: 执行容器命令
Properties:
Service: ECI
API: ExecContainerCommand
Parameters:
RegionId: '{{ RegionId }}'
ContainerGroupId: '{{ ContainerGroupId }}'
ContainerName: '{{ ACS::TaskLoopItem }}'
Command: '{{ Command }}'
Sync: true
Loop:
Items: '{{ GetContainer.ContainerNames }}'
Outputs:
CommandOutputs:
AggregateType: Fn::ListJoin
AggregateField: SyncResponse
Outputs:
SyncResponse:
Type: Json
ValueSelector: .SyncResponse
Outputs:
SyncResponse:
Type: List
Value: '{{ ExecContainerCommand.CommandOutputs }}'