Skip to main content
Version: IB7.0

Job.ExecuteJobV2Async

Description​

The Smart Buddy executes an existing job with job details provided by the connected Control Room.

Signature [C#]​

Task<JobInfo> ExecuteJobV2Async(Dictionary<string, object> inputArgs, int processId, int? botId = null, string logLevel = "Information")

Properties​

Input​

PropertyDescription
inputArgsSpecify the job input arguments.
processIdSpecify the ProcessId to execute the job.
botIdSpecify the SmartBuddy Id to execute the job.
logLevelSpecify the job log level.

Output​

PropertyDescription
Task<JobInfo>Returns the job information of a current job.

Remarks​

Use ExecuteJobV2Async API to execute the job from the connected Control Room.

Example​

C#
public void ExecuteJob()
{
    IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");

    int processId = 1;
    int botId = 1;
    string logLevel = "Information";    
    Dictionary&lt;string, object&gt; inputArgs = new Dictionary&lt;string, object&gt;();
    inputArgs.Add(" ", "{ }");

    JobInfo jobInfo = Task.Run(() => context.Jobs.ExecuteJobV2Async(inputArgs, processId, botId, logLevel)).Result;
    Console.WriteLine("JobId: " + jobInfo.JobId + ", Output: " + jobInfo.Output);
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;

connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);

context.Open();
return context;
}