How to specify hostname, account name and machine name in startjobs Body

Hi Guys,

I am using Orchestrator API to trigger a job can you please help to how to specific the
account to be used, hostname and machine on which the job needs to be ran?
for example

{
“startInfo”: {
“ReleaseKey”: “11}”,
“Strategy”: “ModernJobsCount”,
“JobsCount”: 1,
MachineRobots [
The machine-robot mappings used for running the job.

MachineRobotDto{
MachineId integer($int64)
The Id of the Machine.

MachineName […]
RobotId […]
RobotUserName string
The robot user name
}
}

@Akshay_Suryawanshi

Follow below tutorial,

Happy Automation!!

From the Swagger it gives this as an example, did you try doing it via Swagger?

{
  "startInfo": {
    "ReleaseKey": "string",
    "ReleaseName": "string",
    "Strategy": "All",
    "RobotIds": [
      0
    ],
    "MachineSessionIds": [
      0
    ],
    "NoOfRobots": 0,
    "JobsCount": 0,
    "Source": "Manual",
    "JobPriority": "Low",
    "SpecificPriorityValue": 100,
    "RuntimeType": "NonProduction",
    "InputArguments": "string",
    "EnvironmentVariables": "string",
    "Reference": "string",
    "MachineRobots": [
      {
        "MachineId": 0,
        "MachineName": "string",
        "RobotId": 0,
        "RobotUserName": "string"
      }
    ],
    "TargetFramework": "Legacy",
    "ResumeOnSameContext": true,
    "BatchExecutionKey": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "RequiresUserInteraction": true,
    "StopProcessExpression": "string",
    "StopStrategy": "SoftStop",
    "KillProcessExpression": "string",
    "RemoteControlAccess": "None",
    "AlertPendingExpression": "string",
    "AlertRunningExpression": "string",
    "RunAsMe": true,
    "ParentOperationId": "string",
    "AutopilotForRobots": {
      "Enabled": true,
      "HealingEnabled": true
    },
    "ProfilingOptions": "string",
    "FpsContext": "string",
    "FpsProperties": "string",
    "TraceId": "string",
    "ParentSpanId": "string",
    "RootSpanId": "string",
    "EntryPointPath": "string"
  }
}

I wanted to try this but I don’t know where to pass the account name and hostname in here below json
MachineRobots": [
{
“MachineId”: 0,
“MachineName”: “string”,
“RobotId”: 0,
“RobotUserName”: “string”
}

The easiest way to get the info for this, in my opinion, is to get a job ready to trigger via the Ui in the Orchestrator, then open the console in chrome or your browser and go to the ‘Network’ tab and record the network traffic.

You should be able to see the StartJobs api call that is made when you click the button and examine the body and figure out the syntax you need for the machine / robot etc I think.

1 Like

Thanks, that worked. I didn’t get the details but when I used the same payload multiple times in swagger the job is executed in same hostname and account .

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.