Skip to content

Commit

Permalink
add a generic output schema to the local, remote, and winrm runners. …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
rebrowning committed Jan 12, 2024
1 parent de8948b commit 6b9cf38
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 0 deletions.
40 changes: 40 additions & 0 deletions contrib/runners/local_runner/local_runner/runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@
description: Action timeout in seconds. Action will get killed if it doesn't
finish in timeout seconds.
type: integer
output_key: stdout
output_schema:
type: object
properties:
succeeded:
type: boolean
required: true
failed:
type: boolean
required: true
stdout:
anyOf:
- type: "object"
- type: "string"
required: true
stderr:
type: string
required: true
return_code:
type: integer
- description: A runner to execute local actions as a fixed user.
enabled: true
name: local-shell-script
Expand Down Expand Up @@ -74,3 +94,23 @@
description: Action timeout in seconds. Action will get killed if it doesn't
finish in timeout seconds.
type: integer
output_key: stdout
output_schema:
type: object
properties:
succeeded:
type: boolean
required: true
failed:
type: boolean
required: true
stdout:
anyOf:
- type: "object"
- type: "string"
required: true
stderr:
type: string
required: true
return_code:
type: integer
40 changes: 40 additions & 0 deletions contrib/runners/remote_runner/remote_runner/runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,26 @@
config is used.
required: false
type: string
output_key: stdout
output_schema:
type: object
properties:
succeeded:
type: boolean
required: true
failed:
type: boolean
required: true
stdout:
anyOf:
- type: "object"
- type: "string"
required: true
stderr:
type: string
required: true
return_code:
type: integer
- description: A remote execution runner that executes actions as a fixed system user.
enabled: true
name: remote-shell-script
Expand Down Expand Up @@ -162,3 +182,23 @@
config is used.
required: false
type: string
output_key: stdout
output_schema:
type: object
properties:
succeeded:
type: boolean
required: true
failed:
type: boolean
required: true
stdout:
anyOf:
- type: "object"
- type: "string"
required: true
stderr:
type: string
required: true
return_code:
type: integer
60 changes: 60 additions & 0 deletions contrib/runners/winrm_runner/winrm_runner/runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,26 @@
CA bundle which comes from Mozilla. Verification using a custom CA bundle
is not yet supported. Set to False to skip verification.
type: boolean
output_key: stdout
output_schema:
type: object
properties:
succeeded:
type: boolean
required: true
failed:
type: boolean
required: true
stdout:
anyOf:
- type: "object"
- type: "string"
required: true
stderr:
type: string
required: true
return_code:
type: integer
- description: A remote execution runner that executes PowerShell commands via WinRM on a remote host
enabled: true
name: winrm-ps-cmd
Expand Down Expand Up @@ -134,6 +154,26 @@
CA bundle which comes from Mozilla. Verification using a custom CA bundle
is not yet supported. Set to False to skip verification.
type: boolean
output_key: stdout
output_schema:
type: object
properties:
succeeded:
type: boolean
required: true
failed:
type: boolean
required: true
stdout:
anyOf:
- type: "object"
- type: "string"
required: true
stderr:
type: string
required: true
return_code:
type: integer
- description: A remote execution runner that executes PowerShell script via WinRM on a set of remote hosts
enabled: true
name: winrm-ps-script
Expand Down Expand Up @@ -199,3 +239,23 @@
CA bundle which comes from Mozilla. Verification using a custom CA bundle
is not yet supported. Set to False to skip verification.
type: boolean
output_key: stdout
output_schema:
type: object
properties:
succeeded:
type: boolean
required: true
failed:
type: boolean
required: true
stdout:
anyOf:
- type: "object"
- type: "string"
required: true
stderr:
type: string
required: true
return_code:
type: integer

0 comments on commit 6b9cf38

Please sign in to comment.