LocalCommandRun
LocalCommandRun
LocalCommandRun allows CDP to invoke any OS command locally on the same controller CDP system is running on.
LocalCommandRun shares common properties with other Requests, but has the following specific configuration properties and elements:
Property / Element | Description |
---|---|
CommandLine<string> | Command line (i.e. command with all parameters) to invoke for each request. CommandLine platform-dependent (Linux or Windows) parts can be hidden from other platform, like this:
For example, to run 2 commands sequentially using one CommandLine on both platforms you can use CommandLine: CommandOne [LINUX:;:][WINDOWS:&:] CommandTwo Note: CommandLine property will be processed by FormatTranslator before invoking, so you can use any request channel value in here, that can be useful for using values as part of CommandLine (note that values can also be ValueMap translated to any string). |
UseShell<bool> | When set, command is executed via operating system shell (sh in Linux and cmd in Windows). Default is to use shell. |
WorkingDirectory<string> | Working directory to run the command in. If left empty, CDP application folder is used. |
ClearEnvironment<string> | When set, all system environment variables are cleared before request is run. Default is not to clear existing variables. Note: You can set specific Environment variables for the command using Environment elements (see below). |
GetResponseFrom | Specifies what will be used as request response stream, as input for response translator. Choose between options:
|
ResponseFile<string> | File name to get response body from when GetResponseFrom=File. File name can be either with absolute (full) path or relative to CDP application folder. |
Environment elements | Unlimited number of Name and Value pairs that will be set as command environment before each request invoked. Note: Environment Name and Value properties will be processed by FormatTranslator before setting, so you can use any request channel value in here (can be useful for setting environment variables based on channel values). |
LocalCommandRun state can be observed via these read-only properties:
Property | Description |
---|---|
LastRunTime | Time stamp of the last command run |
LastReturnCode | Return (exit) code of the last command run |
See also shared common properties with other Requests (including the properties controlling what events cause the LocalCommandRun to be launched).
Note: LocalCommandRun will be invoking commands under the same user and privileges as CDP application is run. For security reasons, there is no property or option to escalate privileges for the command.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.