Skip to content
Discussion options

You must be logged in to vote

The input data is available as part of the JSON piped to your process STDIN:

https://docs.xyops.io/plugins/job-input

So you need to consume (read) a line from STDIN, and parse the JSON. The input data is available as input.data inside that JSON record. This is a bit tricky with shell script, as it doesn't have native support for parsing JSON. However, you can use a 3rd party tool such as jq. Example:

#!/bin/bash

IFS= read -r line
foo=$(printf '%s\n' "$line" | jq -r '.input.data.foo')
echo "Foo is: $foo"

The JSON itself is a xyOps Job object, described in full detail here: https://docs.xyops.io/data/job

Example test run setup with pre-populated data:

Job output:

Hope this helps!

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by greenaar
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants