runProcedure

Back to index

Summary

Run the specified procedure, return new job ID. If the --pollInterval option is provided, wait until the job completes up to a maximum of --timeout seconds (if also provided). If the --scheduleName option is provided, the parameters provided by that schedule will be used.

Two types of credentials can be passed to runProcedure:

  • Impersonation credentials

  • Credential parameters

Impersonation credentials:

Impersonation credentials are used to set the top-level impersonation credential for a job. If specified, the impersonation credential for the job is used as the default impersonation credential for all steps in the job.

The impersonation credential can be specified in two ways:

  • If the credentialName argument is supplied, the job looks for the named credential specified. If the user has Execute permissions on the specified credential, runProcedure is allowed to start the job.

  • If the userName and password arguments are supplied, the job creates a transient credential to contain the pair. The transient credential is used by the job and then discarded when the job completes.

Only one of credentialName or userName should be specified. If both are specified, only userName is used. Neither can be specified if the procedure being run already has a credential defined on the procedure or the project.

Credential parameters:

If the procedure defines one or more credential parameters, runProcedure must specify a credential to use for each parameter. The actualParameter argument identifies the credential name to use for the parameter, and the credential argument specifies the username for each defined credential. For each credential specified, runProcedure prompts for a password.

Credential reference parameters:

If the procedure defines one or more credential reference parameters, that is, a parameter that references a credential from an external credential provider, runProcedure must specify a credential reference to use for each parameter. The credentialReferenceParameter argument identifies the reference to the credential name to use for the parameter.

Multiple credential references can be specified by having additional name=value pairs after the credentialReferenceParameter arguments. The same credential reference can be specified as the value for more than one actual parameter.

projectName
Stringrequired
The name for the project that must be unique among all projects.
actualParameter
Arrayoptional
Parameters passed as arguments to the procedure.
credentialName
Stringoptional
The name of the credential argument.
credentialReferenceParameter
Arrayoptional
List of credential parameters with references to existing credentials as parameter values. If the parameter value is a property reference then the credential would be resolved at runtime.
credential
Arrayoptional
Credentials to be used in the job.
destinationProject
Stringoptional
The project that will own the job.
parsedWebhookData
Stringoptional
JSON with parsed webhook data to be set on a pipeline/release/procedure run.
password
Stringoptional
Secret value used to identify the account for a particular user.
priority
Stringoptional
The priority of the job.
Possible values: "low", "normal", "high", "highest"
procedureName
Stringoptional
Name for the procedure; must be unique within the project.
scheduleName
Stringoptional
Name for the schedule; must be unique among all schedules for the project.
userName
Stringoptional
User name under which you wish to login.
webhookData
Stringoptional
The webhook data to be set on the pipeline/release/procedure run.
webhookHeaders
Stringoptional
The webhook headers in JSON format to be set on the pipeline/release/procedure run.

Usage

Perl

$cmdr->runProcedure( "test-projectName" # projectName # optionals );

ectool

ectool runProcedure \ "test-projectName" `# projectName` \ # optionals

Examples

Perl

$cmdr->runProcedure("Sample Project", {procedureName => "Delay", actualParameter => {actualParameterName => "Delay Time", value => 10}}); $xpath = $cmdr->runProcedure("BSHTest", {procedureName => "FakeMotoBuild", actualParameter => [ {actualParameterName => "builddir", value => $cwd}, {actualParameterName => "board", value => $board}, {actualParameterName => "myview", value => $cwv}, {actualParameterName => "resourcetouse", value => $resourcetouse}, ]});

ectool

ectool runProcedure <project name> --procedureName <procedure name> --scheduleName <schedule name> ectool runProcedure "Sample Project" --procedureName "Delay" --actualParameter "Delay Time=10"