The step client exposes means to connect to the controller programmatically, access and use step services in a headless way. It also allows to execute locally step controller functionalities like building and running a plan.
The most common cases for a “headless” user is to integrate the automation activities covered with step to a build pipeline for instance and be able to cover following tasks programmatically:
upload and execute keywords
upload and execute plans
download existing plans
access execution metadata and execution results (report nodes)
All of these workflows are supported by step’s java client API and more.
When interactive with step in a headless way, we believe it is best to learn by example, which is why we’ve provided examples (see link at the beginning of the section) and put emphasis on the javadocs. However below is a description of the services provided by the API:
By instantiating a StepClient, you will have access to most step functionalities through diverse accessors as described below:
Create a step Client
Create a client connecting to a physical controller or able to execute (limited) functions locally
see the method controllerClientDemo in StepClientDemo
Manage remotely a controller (i.e. shutdown gracefully)
Search executions with different type of criteria.
//Search executions active within the given interval
List<Execution>executions=newArrayList<>();HashMap<String,String>criteria=newHashMap<>();criteria.put("attributes.name","myNameCriteria");//search order 1 is ascending and -1 descending
booleansearchEndedTestOnly=true;// to search only executions ended within that interval
executionAccessor.findInInterval(criteria,newDate(startTimeInterval),newDate(endTimeInterval),searchEndedTestOnly,newSearchOrder("startTime",1)).forEach(e->executions.add(e));//Search executions running within the given interval (i.e starting and ending in that interval)