Job.GetJobInfoAsync
Description
Gets the Job information with the specified Id from the connected Control Room.
Signature [C#]
Task<JobInfo> GetJobInfoAsync(int jobId)
Properties
Input
Property | Description |
---|---|
jobId | Specify the Id of the Job whose information has to be retrieved. |
Output
Property | Description |
---|---|
Task<JobInfo> | Returns the information of a job. |
Remarks
Use GetJobInfoAsync API to get the information about the specified Job id from the connected Control Room.
Example
C#
public void GetJobInfo()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");
int jobId = 1;
JobInfo jobInfo = Task.Run(() => context.Jobs.GetJobInfoAsync(jobId)).Result;
Console.WriteLine("JobId: " + jobInfo.JobId + ", Job execution status: " + jobInfo.ExecStatus);
}
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;
}