API Reference
This documentation describes the functionality that is available for configuration authors.
Documentation describing the functionality and schema of configuration (workflow, bootstrap etc) is referred to as the model and is available below.
Documentation describing the functionality and schema of the testing harness is available below.
Packages available:
opscotch model:
The opscotch model is relatively straight forward, and uses repeated patterns - once you grasp these you should be able to understand the entire structure.
Here is the outline of the entire structure of the two configurations: the bootstrap and the workflow. Note that not every field is required, so be sure to check the detailed descriptions.
The bootstrap schema
[
{
"agentPrivateKey": "",
"deploymentId": "",
"remoteConfiguration": "",
"remoteConfigurationAuth": "",
"frequency": 0,
"errorHandling": {
"enableLocalLogging": true,
"metrics": {
"enabled": true,
"routingToken": "",
"outputUrl": "",
"outputAuthorization": ""
},
"logs": {
"enabled": true,
"routingToken": "",
"outputUrl": "",
"outputAuthorization": ""
},
"redactionPatterns": [
""
]
},
"hosts" {
"": {
"host": "",
"headers": {
"": ""
},
"allowlist": [
["",""]
],
"data": {}
}
},
"data": {}
}
]
The workflow schema
{
"enabled": true,
"name": "",
"steps": [
{
"enabled": true,
"debug": true,
"type": "",
"stepId": "",
"authenticationProcessor": {
"script": "",
"resource": "",
"data": {}
},
"splitGenerator": {
"script": "",
"resource": "",
"data": {}
}
"urlGenerator": {
"script": "",
"resource": "",
"data": {}
},
"payloadGenerator": {
"script": "",
"resource": "",
"data": {}
}
"itemResultProcessor": {
"script": "",
"resource": "",
"data": {}
}
"resultsProcessor": {
"script": "",
"resource": "",
"data": {}
},
"timer": "",
"persistenceFile",
"data": {}
}
],
"data" : {}
}
JSON Schema in the Model Package:
Scripting context objects in the Model Package:
JSON schema: Workflow
Defines a set of Steps that the agent will perform in order to generate metrics
JSON Properties
The following properties are available to set on the JSON schema.
enabled
Type: Boolean
Enable or disables the loading of the route.
Defaults to true
{
"enabled": false
}
This property is optional
name
Type: String
Required The user friendly name of the route.
{
"name": "my route"
}
This property is required
steps
Type: Array of Step
Required The list of Steps or actions to take to perform the intention of the Workflow.
Please note that steps are not executed in order, rather they are a group of actions that can send messages to one and other. The order of execution is defined by the actions taken by the Step
{
"steps": [
...
]
}
This property is required
data
Type: Object
A JSON Object for adding properties.
Used to pass parameters and data to the JavaScriptSource elements.
These properties will be merged with all other data fields in the json path, available to the step JavaScriptSource elements.
{
"data": {
"somedata" : {
"abc: 123
},
"someotherdata" : [ 1, 2, 3],
}
}
This property is optional
JSON schema: Host
A HTTP(S) host that the agent is expected to communicate with.
This only applies to customer specific hosts, not to Service Provider hosts.
Hosts are defined in Bootstrap.data and WorkflowConfiguration.data
JSON Properties
The following properties are available to set on the JSON schema.
host
Type: String
Required A URL that is used as the base for constructing URLs to call.
{
"host": "https://www.example.com:8080"
}
This property is required
headers
Type: Object of Strings
A object of HTTP headers to be sent with every call.
{
"headers": {
"Content-Type": "application/json;charset=UTF-8",
"Accept": "application/json, text/plain, *\/*"
}
}
This property is optional
allowlist
Type: Array of String tuple
A list of allowed paths that may be called on this host.
A list of regex that will be matched to URL path. Matching results will be allowed, non-matching results will be blocked and logged.
{
"allowlist": [
["GET","/this/is/allowed"],
["POST","/this/.*\/allowed"]
]
}
This property is optional
data
Type: Object
A JSON Object with Additional properties that will accessible during authentication steps",
{
"data": {
"somedata" : {
"abc: 123
},
"someotherdata" : [ 1, 2, 3]
}
}
This property is optional
JSON schema: ErrorHandling
A configuration defining if and how to send error metrics or log to a remote system
Its definition only apply to the process configuration they are defined for. For example the Bootstrap.errorHandling defines error handling while loading configurations, and the WorkflowConfiguration.errorHandling defines error handling during the execution of configuration steps.
JSON Properties
The following properties are available to set on the JSON schema.
enableLocalLogging
Type: Boolean
Enable or disables logging of errors and information to the agent standard out
Defaults to false
{
"enableLocalLogging": true
}
This property is optional
metrics
Type: Output
Defines how error metrics are sent to a remote system.
Error metrics represent a fault in the agent and are sent to a remote system for attention.
Error metric configuration only apply to the process configuration they are defined for. For example the Bootstrap.errorHandling defines error handling while loading configurations, and the WorkflowConfiguration.errorHandling defines error handling during the execution of configuration steps.
{
"metrics": {
...
}
}
This property is optional
logs
Type: Output
Defines how error logs are sent to a remote system.
Error logs are brief messages from a fault in the agent and are sent to a remote system for attention.
Error log configuration only apply to the process configuration they are defined for. For example the Bootstrap.errorHandling defines error handling while loading configurations, and the WorkflowConfiguration.errorHandling defines error handling during the execution of configuration steps.
{
"logs": {
...
}
}
This property is optional
redactionPatterns
Type: Array of String
Defines regex patterns to apply redaction to log statements
Log statements from will have these redaction patterns applied before logging.
{
"redactionPatterns": [
"[0-9]+"
]
}
This property is optional