Skip to content

Non-existing integrations / custom commands (shell, curl, etc) #1232

Closed Answered by chris-rock
shafr asked this question in Q&A
Discussion options

You must be logged in to vote

@shafr Thank you for raising that question. You have quite some interesting potential integrations. I would love to hear a bit more about the use cases to give better guidance.

You always have the option to shell out. With MQL you have the command resource available when you on a local target eg. cnquery shell local:

cnquery> data = command("curl http://date.jsontest.com/").stdout; parse.json(content: data).params
parse.json.params: {
  date: "05-23-2023"
  milliseconds_since_epoch: 1684866165523.000000
  time: "06:22:45 PM"
}

Then you could do assertions on top of that:

cnquery> data = command("curl http://date.jsontest.com/").stdout; parse.json(content: data).params["date"] == "05-23-2…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shafr
Comment options

Answer selected by shafr
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