Skip to content

Commit 9ddd7f8

Browse files
committed
add a generic output schema to the local, remote, and winrm runners. St2 already appears to return the data in this format, this is simply formalizing the response so that validations can be added for commands leveraging these runners to better allow users of st2 to verify the integrity of the data their pipelines are processing
1 parent d940fd6 commit 9ddd7f8

File tree

3 files changed

+140
-0
lines changed

3 files changed

+140
-0
lines changed

contrib/runners/local_runner/local_runner/runner.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,26 @@
3333
description: Action timeout in seconds. Action will get killed if it doesn't
3434
finish in timeout seconds.
3535
type: integer
36+
output_key: stdout
37+
output_schema:
38+
type: object
39+
properties:
40+
succeeded:
41+
type: boolean
42+
required: true
43+
failed:
44+
type: boolean
45+
required: true
46+
stdout:
47+
anyOf:
48+
- type: "object"
49+
- type: "string"
50+
required: true
51+
stderr:
52+
type: string
53+
required: true
54+
return_code:
55+
type: integer
3656
- description: A runner to execute local actions as a fixed user.
3757
enabled: true
3858
name: local-shell-script
@@ -74,3 +94,23 @@
7494
description: Action timeout in seconds. Action will get killed if it doesn't
7595
finish in timeout seconds.
7696
type: integer
97+
output_key: stdout
98+
output_schema:
99+
type: object
100+
properties:
101+
succeeded:
102+
type: boolean
103+
required: true
104+
failed:
105+
type: boolean
106+
required: true
107+
stdout:
108+
anyOf:
109+
- type: "object"
110+
- type: "string"
111+
required: true
112+
stderr:
113+
type: string
114+
required: true
115+
return_code:
116+
type: integer

contrib/runners/remote_runner/remote_runner/runner.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,26 @@
8282
config is used.
8383
required: false
8484
type: string
85+
output_key: stdout
86+
output_schema:
87+
type: object
88+
properties:
89+
succeeded:
90+
type: boolean
91+
required: true
92+
failed:
93+
type: boolean
94+
required: true
95+
stdout:
96+
anyOf:
97+
- type: "object"
98+
- type: "string"
99+
required: true
100+
stderr:
101+
type: string
102+
required: true
103+
return_code:
104+
type: integer
85105
- description: A remote execution runner that executes actions as a fixed system user.
86106
enabled: true
87107
name: remote-shell-script
@@ -162,3 +182,23 @@
162182
config is used.
163183
required: false
164184
type: string
185+
output_key: stdout
186+
output_schema:
187+
type: object
188+
properties:
189+
succeeded:
190+
type: boolean
191+
required: true
192+
failed:
193+
type: boolean
194+
required: true
195+
stdout:
196+
anyOf:
197+
- type: "object"
198+
- type: "string"
199+
required: true
200+
stderr:
201+
type: string
202+
required: true
203+
return_code:
204+
type: integer

contrib/runners/winrm_runner/winrm_runner/runner.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,26 @@
6666
CA bundle which comes from Mozilla. Verification using a custom CA bundle
6767
is not yet supported. Set to False to skip verification.
6868
type: boolean
69+
output_key: stdout
70+
output_schema:
71+
type: object
72+
properties:
73+
succeeded:
74+
type: boolean
75+
required: true
76+
failed:
77+
type: boolean
78+
required: true
79+
stdout:
80+
anyOf:
81+
- type: "object"
82+
- type: "string"
83+
required: true
84+
stderr:
85+
type: string
86+
required: true
87+
return_code:
88+
type: integer
6989
- description: A remote execution runner that executes PowerShell commands via WinRM on a remote host
7090
enabled: true
7191
name: winrm-ps-cmd
@@ -134,6 +154,26 @@
134154
CA bundle which comes from Mozilla. Verification using a custom CA bundle
135155
is not yet supported. Set to False to skip verification.
136156
type: boolean
157+
output_key: stdout
158+
output_schema:
159+
type: object
160+
properties:
161+
succeeded:
162+
type: boolean
163+
required: true
164+
failed:
165+
type: boolean
166+
required: true
167+
stdout:
168+
anyOf:
169+
- type: "object"
170+
- type: "string"
171+
required: true
172+
stderr:
173+
type: string
174+
required: true
175+
return_code:
176+
type: integer
137177
- description: A remote execution runner that executes PowerShell script via WinRM on a set of remote hosts
138178
enabled: true
139179
name: winrm-ps-script
@@ -199,3 +239,23 @@
199239
CA bundle which comes from Mozilla. Verification using a custom CA bundle
200240
is not yet supported. Set to False to skip verification.
201241
type: boolean
242+
output_key: stdout
243+
output_schema:
244+
type: object
245+
properties:
246+
succeeded:
247+
type: boolean
248+
required: true
249+
failed:
250+
type: boolean
251+
required: true
252+
stdout:
253+
anyOf:
254+
- type: "object"
255+
- type: "string"
256+
required: true
257+
stderr:
258+
type: string
259+
required: true
260+
return_code:
261+
type: integer

0 commit comments

Comments
 (0)