Client Tutorial - Automate
Overview
Conveniently, this scenario includes several of the more complicated commands requiring submission of parameters.
This scenario assumes VersionOne Continuum Client is installed and the .ctmclient.conf file set up properly.
[Click here](/docs/velocity/client/client.html) for information about setting up the Client tools.
To confirm the Client is installed, and the REST API is running, try this command:
ctm-version
This will return the current version.
List Tasks
ctm-list-tasks
Will return a list of all defined Tasks.
Output Format
All Client commands return results as 'text' by default. Almost all commands can optionally return as 'JSON' or 'XML' documents.
Specify the `-Fjson` or `-Fxml` option after a command to request a different format.
ctm-list-tasks -Fjson
'Text' output is geared toward human-readability, so only key properties are returned. 'JSON' and 'XML' formats will almost always return more verbose information.
Running a Task
ctm-run-task
Running a Task can be done simply if there are no parameters.
ctm-run-task -tTaskName
Running a Task in a scripted fashion requires a parameters document to be created and submitted with the command.
ctm-get-task-parameters -tTaskName > /tmp/taskparams
This command will return a simple JSON template - a list of parameters. For example:
[ { "values": [ "hello" ], "name": "param_1" } ]
Edit the values as necessary, save the file. Then pass the file to the command.
ctm-run-task -tTaskName -p/tmp/taskparams
Checking Task Status
To see a list of currently active Tasks.
ctm-get-task-instances
This command returns active Tasks by default, but the `-s` option can specify additional statuses. The `-s all` option will display all status, or a delimited list of specific statuses can be provided: `-s Error,Cancelled`
Single Task Status
To see details of a specific Task Instance ID, for example Instance 123.
ctm-get-task-instance -i123
Remember, for full details select either JSON or XML as the output format.
ctm-get-task-instance -i123 -Fjson
Or if you'd like a super simple response, just the status:
ctm-get-task-instance-status -i123
Task Run Log
Finally, to retrieve the Task Run Log.
ctm-get-task-log -i123
All Commands
To see a list of all available commands:
ctm-list-commands
To see specific arguments for any command, specify the `-H` option.