Actions support parameters for configuration purposes. For example, you may want to use a parameter of type duration
to configure how long an action is
supposed to take. This document explains what the supported parameter types are and how they work.
Supported parameter types:
boolean
duration
integer
percentage
string
string_array
password
file
key_value
textarea
url
separator
header
bitrate
stressng-workers
regex
target-selection
Either true
or false
values. With optional support for null
when required=false
and no defaultValue
is
defined.
{
"name": "activateOrder66",
"label": "Eradicate Jedi Order?",
"type": "boolean",
"defaultValue": "false"
}
{
"activateOrder66": true
}
{
"activateOrder66": null
}
A time duration. Renders appropriate UI controls that facilitate time inputs—exposed as number
s representing
milliseconds to extensions.
Note: Make sure to name the field duration
should you desire that the experiment editor uses a duration field to
visualize the expected length of an action.
{
"name": "jarJarBinksSongDuration",
"label": "How long do you want to be bothered by Jar Jar Binks?",
"type": "duration",
"defaultValue": "0s"
}
{
"jarJarBinksSongDuration": 5000 // milliseconds
}
{
"jarJarBinksSongDuration": null
}
Any integer number.
{
"name": "starWarsEpisode",
"label": "What is your favorite Star Wars episode?",
"type": "integer",
"defaultValue": "4"
}
{
"starWarsEpisode": 5
}
{
"starWarsEpisode": null
}
percentage
is a variation of the integer
parameter that renders more appropriate user interface controls. A value of
0% is represented as the number 0
. 100% is represented as the number 100
.
{
"name": "deathStarEnergyLevel",
"label": "How much should the Death Star be charged?",
"type": "percentage",
"defaultValue": "69"
}
{
"deathStarEnergyLevel": 69
}
{
"deathStarEnergyLevel": null
}
Strings are the most fundamental parameter type. They represent arbitrary character sequences just like you would expect.
Note: It is the responsibility of an extension to decide what to do when receiving an empty string.
{
"name": "fullName",
"label": "Full Name",
"type": "string",
"defaultValue": "Jane Doe"
}
{
"name": "fullName",
"label": "Full Name",
"type": "string",
"options": [
{
"label": "Jane Doe",
"value": "Jane Doe"
},
{
"label": "Admiral Ackbar",
"value": "Admiral Ackbar"
}
]
}
{
"name": "fullName",
"label": "Full Name",
"type": "string",
"optionsOnly": false,
"options": [
{
"label": "Jane Doe",
"value": "Jane Doe"
},
{
"label": "Admiral Ackbar",
"value": "Admiral Ackbar"
}
]
}
Indicates if the action should only support the provided options or if the user can enter a custom value. If
optionsOnly
is set to true
or is left out, the user can only select from the provided options. If optionsOnly
is
set to false
, the user can select from the provided options or enter a custom value.
{
"fullName": "Admiral Ackbar"
}
{
"fullName": ""
}
{
"fullName": null
}
You can use the string_array
type for multiple textual inputs.
You may define options that users can select. Options are either explicit, i.e., fixed and known in advance (
identifiable by the label
and value
properties). Or options based on target attributes' values (identifiable by the
attribute
property).
{
"name": "lightsaberCombatForm",
"label": "Lightsaber Combat Form",
"type": "string_array",
"defaultValue": "[\"shii_cho\", \"ataru\"]",
"options": [
{
"label": "Shii-Cho",
"value": "shii_cho"
},
{
"label": "Makashi",
"value": "makashi"
},
{
"label": "Soresu",
"value": "soresu"
},
{
"label": "Ataru",
"value": "ataru"
},
// or automatically created options from all known values for this target attribute key
{
"attribute": "combat.form"
}
]
}
{
"lightsaberCombatForm": ["soresu"]
}
{
"lightsaberCombatForm": []
}
{
"lightsaberCombatForm": null
}
The password
parameter behaves like the string
parameter type, except for the visual presentation in the Steadybit
user interface.
Files can be uploaded and passed to actions through a parameter of the file
type. Uploaded files are delivered to
actions in base64 encoding. Through the optional acceptedFileTypes
option you can
restrict what kind of files
may be selected by users.
If an action has a parameter of the file
type, the prepare request will be a
multipart/form-data
request. The files will be parts of the request body.
{
"name": "schematics",
"label": "Space Ship Schematics",
"type": "file",
"acceptedFileTypes": [".svg", ".dwg"]
}
{
"schematics": "WW91IGFyZSBxdWl0ZSBjdXJpb3VzISBIZXJlLCBoYXZlIGEgY29va2llISBBbHNvLCBjaGVjayBvdXQgaHR0cHM6Ly9zdGFyd2Fycy5mYW5kb20uY29tL3dpa2kvRGVhdGhfU3Rhcl9wbGFucyE="
}
{
"schematics": null
}
For key/value pairs, e.g., tags, labels and environment variables, we support a key_value
parameter type.
{
"name": "env",
"label": "Environment",
"type": "key_value",
}
{
"env": [
{
"key": "Dagobah",
"value": "humid"
}
]
}
{
"env": []
}
For a large string, we support a textarea
parameter type.
{
"name": "body",
"label": "Body",
"type": "textarea"
}
{
"body": "looooooong string"
}
{
"body": null
}
For URLs, we support a url
parameter type.
{
"name": "targetUrl",
"label": "Target URL",
"type": "url"
}
{
"targetUrl": "https://steadybit.com"
}
{
"targetUrl": null
}
For a common separator in the settings field list, we support a separator
parameter type.
{
"name": "-",
"label": "-",
"type": "separator"
}
you will not recieve values for this parameter type
For a common header in the settings field list, we support a header
parameter type.
{
"name": "importantSettings",
"label": "Important Settings",
"type": "header"
}
you will not recieve values for this parameter type
Defines a bitrate with value and unit E.g.:
- 1024kbps: 1024 Kilobytes per second
- 10mbps: 10 Megabytes per second
- 64kbit: 64 Kilobits per second
- 10mbit: 10 Megabits per second
{
"name": "bandwidth",
"label": "How fast you want to go?",
"type": "bitrate",
"defaultValue": "1024kbit"
}
{
"bandwidth": "1024kbit"
}
{
"activateOrder66": null
}
Defines how many workers should be used for stressng
- 0: all cpu cores
-
0: number of workers
{
"name": "workers",
"label": "Stress-ng Workters",
"type": "stressng-workers",
"defaultValue": "0"
}
{
"worker": 0
}
{
"worker": null
}
Defines a regular expression, which is used to validate the input value as a regular expression.
The validation will be done on server side with java
regex flavor.
{
"name": "hostname",
"label": "Hostname to match",
"type": "regex",
"defaultValue": ".*"
}
{
"hostname": ".*"
}
{
"hostname": null
}
This is a dummy parameter type to allow to specify the position of the target selection in the UI. If this is not added to the list of parameters, the target selection will always be rendered at the top in the action settings sidebar.
{
"name": "-",
"label": "Filter location",
"type": "target-selection"
}