When starting a job from ectool, if you don't provide a required parameter it fails stating that there is a missing parameter, even though the parameter is defined to have a default value. This is counter intuitive since there is already a default value defined.
Non-required parameters get their default values.
This functionality actually works as designed, below we explain how it works. But to change the behavior, you will need to do one of the following:
* If you want the runProcedure to take the default values, remove the "Required" check box, and the default values will be used
* If you want the parameter to be required, you will have to supply the values on the command line using the --actualParameter option
When you run the procedure in the UI, the default parameter is shown in the UI but you still have to accept it by clicking the Run button. When you are running from the command line, the default values are not used, so you must supply a value for all required parameters. The web UI pre-populates the default value and passes it along across the wire.
If you tail the commander.log file, then interact with the UI to launch the procedure then you’ll see this:
If you try to launch on the command line:
Notice in the web ui version we passed an actualParameter. In the command line invocation we did not.
You can get the default value through the API and pass it to your ectool command via script. Here is how you can get the default value on the formal parameter (as I said, the default value is stored in the db)
vagrant@commander4to5:~$ /opt/electriccloud/electriccommander/bin/ectool getFormalParameters Default --procedureName Test
If you tail the commander.log when viewing the "Run…" page you will see that the web ui also issued the getFormalParameters query as well.
Our web UI merely issues multiple requests to get the default value and pre-populate the default value into the actualParameter.