This guide creates a simple but realistic API smoke-test flow using the public data.gov.au CKAN API with:
- 1 setting (
Demo:DataGovApiBaseUrl) - 1 secret (
Demo:DataGovApiKey) collected by a workflow step - 2 saved commands
- 1 workflow that runs the 2 commands in sequence
- Prerequisites
- 1) Add one setting
- 2) Create two saved commands
- 3) Create one workflow using the two commands
- 4) Validate what was created
- 5) Run the workflow
- 6) Run interactively (optional)
- .NET SDK 10+
- BYO CLI installed and available on your
PATH
Quick check:
byo --helpThe first time you run byo in a terminal it asks whether you want to give the CLI your own name, its alias. Answer no to skip it. You will not be asked again, and you can set one later with byo alias set.
byo settings set --key Demo:DataGovApiBaseUrl --value https://www.data.gov.au/data/api/3/actionbyo commands set --name "Data.gov.au Package Search" --bookmark "Examples/GettingStarted" --shell PowerShell --executable "curl.exe --ssl-no-revoke -H 'X-API-Key: {{Demo:DataGovApiKey}}' '{{Demo:DataGovApiBaseUrl}}/package_search?q=transport&rows=3'"byo commands set --name "Data.gov.au Organization List" --bookmark "Examples/GettingStarted" --shell PowerShell --executable "curl.exe --ssl-no-revoke -H 'X-API-Key: {{Demo:DataGovApiKey}}' '{{Demo:DataGovApiBaseUrl}}/organization_list?limit=10'"Run:
byo workflows set --name "Data.gov.au API Smoke Test" --bookmark "Examples/GettingStarted"When prompted, add steps in this order:
- Message
- Enter message to display:
Starting data.gov.au API smoke test - Color:
Cyan - Wait for Enter:
No
- Enter message to display:
- Input As Secret
- Prompt:
Enter data.gov.au API key - Secret key:
Demo:DataGovApiKey
- Prompt:
- Execute Command
- Command:
Data.gov.au Package Search - Run asynchronously:
No
- Command:
- Execute Command
- Command:
Data.gov.au Organization List - Run asynchronously:
No
- Command:
- Done - Finish adding steps
byo settings list
byo commands list
byo workflows listThe secret is not shown by byo settings list. It is stored encrypted by the InputAsSecret step and resolved when the commands run. To inspect it directly, use byo secrets list.
byo run --target workflow --name "Data.gov.au API Smoke Test" --bookmark "Examples/GettingStarted"The workflow runs immediately and executes both commands in sequence.
You can choose a saved command or workflow from the bookmark hierarchy by
omitting --name:
byo run --target command
byo run --target workflow