Process Instance API

Contents

/processinstance 

Description

Gets job list for a process.

URL structure

httpsː//smart.cloud.com/v0/processinstance?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance?access_token=nvk7QZGTybCKItXCb4XTxXGqt&processid=8277

Method

GET

Parameters

processid (required)

Sample response:

[
   {
      "actionGroupId":8251,
      "targetGroupId":0,
      "jobId":8263,
      "status":"complete",
      "targetDetailBeans":[

      ],
      "serverGroups":[

      ],
      "jobName":"REST Test (1)",
      "jobDescription":"This job is auto-created.",
      "parentJobId":0,
      "role":"Admin",
      "companyId":40034,
      "tagList":[

      ],
      "lastRunStatus":"complete",
      "scheduleBeans":[
         {
            "scheduleId":41774,
            "jobId":0,
            "status":"complete",
            "nextFireTime":0,
            "repeatCount":1,
            "endTime":86560703999426,
            "startTime":1363216404283,
            "scheduleType":12,
            "prevFireTime":1363216404283,
            "repeatInterval":1,
            "timesTriggered":1,
            "dirty":false,
            "role":"Admin",
            "companyId":40034,
            "user":"10087"
         }
      ],
      "user":"10087"
   }
]

Back to top

/processinstance/{id} 

Description

Gets process instance details.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8263?access_token=nvk7QZGTybCKItXCb4XTxXGqt

Method

GET

Sample response:

{
   "startCode":"SCRIPT1",
   "excludeTarget":[

   ],
   "processId":8277,
   "processName":"REST Test (1)",
   "version":"1",
   "subProcesses":[

   ],
   "startTaskId":0,
   "role":"Admin",
   "outputs":[

   ],
   "targets":[

   ],
   "processParameters":[

   ],
   "excludeTargets":[

   ],
   "parentProcessId":0,
   "tasks":[
      {
         "continueOnFailure":0,
         "processId":0,
         "excludeTarget":[

         ],
         "taskName":"SCRIPT1",
         "sequenceNumber":0,
         "nextTaskId":0,
         "outputs":[

         ],
         "parentTaskId":0,
         "stepCode":"RUN_SCRIPT_STEP",
         "taskId":0,
         "runType":"remote",
         "sequenceNext":"SCRIPT2",
         "code":"SCRIPT1",
         "properties":[
            {
               "processId":0,
               "propertyValue":"7545",
               "propertyKey":"scriptId",
               "companyId":0,
               "required":false,
               "type":"string",
               "propValueArr":[

               ]
            },
            {
               "processId":0,
               "propertyValue":"4",
               "propertyKey":"version",
               "companyId":0,
               "required":false,
               "type":"string",
               "propValueArr":[

               ]
            },
            {
               "processId":0,
               "propertyValue":"40034/10087/1351197110403/",
               "propertyKey":"scriptLocation",
               "companyId":0,
               "required":false,
               "type":"string",
               "propValueArr":[

               ]
            },
            {
               "processId":0,
               "propertyValue":".sh",
               "propertyKey":"scriptType",
               "companyId":0,
               "required":false,
               "type":"string",
               "propValueArr":[

               ]
            }
         ],
         "runAsyncFlag":0,
         "runAsync":false,
         "taskParameters":[

         ],
         "inputs":[

         ],
         "target":[

         ],
         "taskProperties":[

         ],
         "tagList":[

         ],
         "serverGroup":[

         ],
         "companyId":0,
         "timeout":0,
         "rootProcessId":0
      },
      {
         "continueOnFailure":0,
         "taskId":0,
         "excludeTarget":[

         ],
         "runType":"remote",
         "processId":0,
         "properties":[
            {
               "processId":0,
               "propertyValue":"7339",
               "propertyKey":"scriptId",
               "companyId":0,
               "required":false,
               "type":"string",
               "propValueArr":[

               ]
            },
            {
               "processId":0,
               "propertyValue":"3",
               "propertyKey":"version",
               "companyId":0,
               "required":false,
               "type":"string",
               "propValueArr":[

               ]
            },
            {
               "processId":0,
               "propertyValue":"40034/10087/1349374450927/",
               "propertyKey":"scriptLocation",
               "companyId":0,
               "required":false,
               "type":"string",
               "propValueArr":[

               ]
            },
            {
               "processId":0,
               "propertyValue":".sh",
               "propertyKey":"scriptType",
               "companyId":0,
               "required":false,
               "type":"string",
               "propValueArr":[

               ]
            }
         ],
         "code":"SCRIPT2",
         "runAsyncFlag":0,
         "taskName":"SCRIPT2",
         "sequenceNumber":0,
         "runAsync":false,
         "inputs":[

         ],
         "taskParameters":[

         ],
         "nextTaskId":0,
         "target":[

         ],
         "taskProperties":[

         ],
         "companyId":0,
         "serverGroup":[

         ],
         "tagList":[

         ],
         "outputs":[

         ],
         "parentTaskId":0,
         "rootProcessId":0,
         "timeout":0,
         "stepCode":"RUN_SCRIPT_STEP"
      }
   ],
   "serverGroups":[

   ],
   "code":"P1",
   "properties":[

   ],
   "migratedFlag":true,
   "runAsync":false,
   "schedule":{
      "startTime":1363216404283,
      "scheduleType":12,
      "scheduleId":0,
      "prevFireTime":0,
      "jobId":0,
      "repeatInterval":1,
      "timesTriggered":0,
      "nextFireTime":0,
      "dirty":false,
      "repeatCount":1,
      "companyId":0,
      "endTime":86560732799290
   },
   "parentCompanyId":0,
   "parentGroupId":0,
   "inputs":[
      {
         "processId":0,
         "propertyValue":"123",
         "propertyKey":"key",
         "companyId":0,
         "required":false,
         "type":"string",
         "propValueArr":[

         ]
      }
   ],
   "target":[
      {
         "processId":0,
         "propertyValue":"2515",
         "propertyKey":"agent_id",
         "companyId":0,
         "required":false,
         "type":"int",
         "propValueArr":[

         ]
      },
      {
         "processId":0,
         "propertyValue":"2478",
         "propertyKey":"agent_id",
         "companyId":0,
         "required":false,
         "type":"int",
         "propValueArr":[

         ]
      }
   ],
   "companyId":40034,
   "tagList":[

   ],
   "serverGroup":[

   ],
   "user":"10087",
   "timeout":0,
   "rootProcessId":0
}

Back to top

/processinstance/{id}/childjobs 

Description

Gets job list for a child process.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/childjobs?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/290/childjobs?access_token=nvk7QZGTybCKItXCb4XTxXGqt&type=operational

Method

GET

Parameters

type (optional)
Valid values are:

  • operational
  • shutdown

If no type is specified, all child jobs for that process are given, if there is any schedule attached to the child process.

Sample response:

{
   "result":"SUCCESS",
   "data":[
      {
         "actionGroupId":292,
         "targetGroupId":0,
         "jobId":290,
         "status":"complete",
         "targetDetailBeans":[

         ],
         "serverGroups":[

         ],
         "jobName":"Operational Process (19)",
         "jobDescription":"This job is auto-created.",
         "parentJobId":0,
         "role":"Admin",
         "companyId":40338,
         "tagList":[

         ],
         "lastRunStatus":"FAILED",
         "scheduleBeans":[
            {
               "scheduleId":39682,
               "jobId":0,
               "status":"complete",
               "nextFireTime":0,
               "repeatCount":100,
               "endTime":86560732799136,
               "startTime":1360277440124,
               "scheduleType":14,
               "prevFireTime":1360295260124,
               "repeatInterval":3,
               "timesTriggered":100,
               "dirty":false,
               "role":"Admin",
               "companyId":40338,
               "user":"10425"
            }
         ],
         "user":"10425"
      }
   ]
}

Back to top

/processinstance/{id}/processrundetails 

Description

Gets process run details.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<jobid>/processrundetails?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8263/processrundetails?access_token=nvk7QZGTybCKItXCb4XTxXGqt

Method

GET

Sample response:

[
   {
      "processInstanceRunBeans":[

      ],
      "jobId":8263,
      "taskPropertyBeans":[

      ],
      "status":"complete",
      "role":"Admin",
      "jobRunOutputBeans":[

      ],
      "companyId":40034,
      "runId":47396,
      "projectId":-1,
      "user":"",
      "runTimestamp":1363216404320
   }
]

Back to top

/processinstance/{id}/processruns 

Description

Gets process runs

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/processruns?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8263/processruns?access_token=nvk7QZGTybCKItXCb4XTxXGqt&runid=47396

Method

GET

Parameters

Name Required or Optional
runid Required
code Optional

Sample response:

[  
   {  
      "processCode":"P1",
      "status":"complete",
      "parentProcessCode":"",
      "executionSequence":1,
      "processName":"REST Test (1)",
      "serialversionuid":1,
      "companyId":0,
      "processInstancerunId":1185,
      "childProcessInstancerunBean":[  

      ]
   }
]

Back to top

/processinstance/{id}/stepruns 

Description

Gets step runs

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/stepruns?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8263/stepruns?access_token=nvk7QZGTybCKItXCb4XTxXGqt&instanceid=1185

Method

GET

Parameters

instanceid (required)

Sample response:

[
   {
      "targetDetailBean":{
         "agentId":0,
         "companyId":0
      },
      "stepRunLogOutputBean":{
         "stepRunId":0,
         "companyId":0
      },
      "stepRunId":0,
      "executionSequence":2,
      "jobDetailId":8263,
      "taskName":"SCRIPT1",
      "projectRunId":47396,
      "runStatus":"complete",
      "processInstanceRunId":0,
      "stepOutputType":0,
      "companyId":40034,
      "stepId":1231,
      "stepCode":"SCRIPT1"
   },
   {
      "targetDetailBean":{
         "agentId":0,
         "companyId":0
      },
      "stepRunLogOutputBean":{
         "stepRunId":0,
         "companyId":0
      },
      "stepRunId":0,
      "executionSequence":3,
      "jobDetailId":8263,
      "taskName":"SCRIPT2",
      "projectRunId":47396,
      "runStatus":"complete",
      "processInstanceRunId":0,
      "stepOutputType":0,
      "companyId":40034,
      "stepId":1232,
      "stepCode":"SCRIPT2"
   }
]

Back to top

/processinstance/{id}/stepdetails 

Description

Gets step details

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/stepdetails?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8263/stepdetails?access_token=nvk7QZGTybCKItXCb4XTxXGqt&runid=47396&stepid=1232

Method

GET

Parameters

Name Required or Optional
instanceid Required
stepid Required

Sample response:

{
   "continueOnFailure":0,
   "processId":0,
   "excludeTarget":[

   ],
   "taskName":"SCRIPT2",
   "sequenceNumber":0,
   "nextTaskId":0,
   "className":"com.centro.task.step.RunScriptStep",
   "outputs":[
      {
         "processId":0,
         "propertyKey":"agents",
         "companyId":0,
         "required":false,
         "type":"array",
         "propValueArr":[
            {
               "processId":0,
               "propertyKey":"skip",
               "companyId":0,
               "required":false,
               "type":"array",
               "propValueArr":[
                  {
                     "processId":0,
                     "propertyValue":"2515",
                     "propertyKey":"agent_id",
                     "companyId":0,
                     "required":false,
                     "type":"int",
                     "propValueArr":[

                     ]
                  },
                  {
                     "processId":0,
                     "propertyValue":"0",
                     "propertyKey":"exitcode",
                     "companyId":0,
                     "required":false,
                     "type":"string",
                     "propValueArr":[

                     ]
                  },
                  {
                     "processId":0,
                     "propertyValue":"helloWorld\r\n",
                     "propertyKey":"output",
                     "companyId":0,
                     "required":false,
                     "type":"string",
                     "propValueArr":[

                     ]
                  }
               ]
            },
            {
               "processId":0,
               "propertyKey":"skip",
               "companyId":0,
               "required":false,
               "type":"array",
               "propValueArr":[
                  {
                     "processId":0,
                     "propertyValue":"2478",
                     "propertyKey":"agent_id",
                     "companyId":0,
                     "required":false,
                     "type":"int",
                     "propValueArr":[

                     ]
                  },
                  {
                     "processId":0,
                     "propertyValue":"0",
                     "propertyKey":"exitcode",
                     "companyId":0,
                     "required":false,
                     "type":"string",
                     "propValueArr":[

                     ]
                  },
                  {
                     "processId":0,
                     "propertyValue":"helloWorld\r\n",
                     "propertyKey":"output",
                     "companyId":0,
                     "required":false,
                     "type":"string",
                     "propValueArr":[

                     ]
                  }
               ]
            }
         ]
      },
      {
         "processId":0,
         "propertyValue":"complete",
         "propertyKey":"Status",
         "companyId":0,
         "required":false,
         "type":"string",
         "propValueArr":[

         ]
      }
   ],
   "parentTaskId":0,
   "stepCode":"RUN_SCRIPT_STEP",
   "taskId":0,
   "runType":"remote",
   "code":"SCRIPT2",
   "properties":[
      {
         "processId":0,
         "propertyValue":"7339",
         "propertyKey":"scriptId",
         "companyId":0,
         "required":false,
         "type":"string",
         "propValueArr":[

         ]
      },
      {
         "processId":0,
         "propertyValue":"3",
         "propertyKey":"version",
         "companyId":0,
         "required":false,
         "type":"string",
         "propValueArr":[

         ]
      },
      {
         "processId":0,
         "propertyValue":"40034/10087/1349374450927/",
         "propertyKey":"scriptLocation",
         "companyId":0,
         "required":false,
         "type":"string",
         "propValueArr":[

         ]
      },
      {
         "processId":0,
         "propertyValue":".sh",
         "propertyKey":"scriptType",
         "companyId":0,
         "required":false,
         "type":"string",
         "propValueArr":[

         ]
      }
   ],
   "runAsyncFlag":0,
   "runAsync":false,
   "taskParameters":[

   ],
   "inputs":[

   ],
   "target":[

   ],
   "taskProperties":[

   ],
   "serverGroup":[

   ],
   "tagList":[

   ],
   "companyId":0,
   "timeout":0,
   "rootProcessId":0
}

Back to top

/processinstance/{id}/stepoutput 

Description

Gets step output.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/stepoutput?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8263/stepoutput?access_token=nvk7QZGTybCKItXCb4XTxXGqt&stepid=1232

Method

GET

Parameters

stepid (required)

Sample response:

[  
   {  
      "targetDetailBean":{  
         "nodeMac":"40:40:90:c1:db:bc",
         "nodeIf":"eth0",
         "nodeDesc":"",
         "osCat":"#1 SMP Fri May 20 03:51:51 BST 2011",
         "agentId":2515,
         "hostName":"test-zss1-db",
         "companyId":0,
         "nodeHw":"x86_64",
         "osName":"Linux",
         "ipAddress":"50.57.187.29"
      },
      "stepExitCode":"0",
      "stepTagLoc":"/opt/citrix/mitos/proc",
      "stepRunLogOutputBean":{  
         "outputText":"helloWorld\r\n",
         "stepRunId":70974,
         "companyId":0
      },
      "stepRunId":70974,
      "executionSequence":0,
      "jobDetailId":8263,
      "projectRunId":47396,
      "stepTag":"metaphas-1363216411001",
      "runStatus":"complete",
      "remoteServerName":"2515",
      "activeFlag":"Y",
      "processInstanceRunId":0,
      "stepOutputType":1,
      "companyId":0,
      "stepId":1232,
      "stepType":"step"
   },
   {  
      "targetDetailBean":{  
         "nodeMac":"40:40:70:ef:29:de",
         "nodeIf":"eth0",
         "nodeDesc":"",
         "osCat":"#37-Ubuntu SMP Wed Apr 25 10:17:19 UTC 2012",
         "agentId":2478,
         "hostName":"ubuntu1204-ms-sx5",
         "companyId":0,
         "nodeHw":"x86_64",
         "osName":"Linux",
         "ipAddress":"198.61.192.135"
      },
      "stepExitCode":"0",
      "stepTagLoc":"/opt/citrix/mitos/proc",
      "stepRunLogOutputBean":{  
         "outputText":"helloWorld\r\n",
         "stepRunId":70975,
         "companyId":0
      },
      "stepRunId":70975,
      "executionSequence":0,
      "jobDetailId":8263,
      "projectRunId":47396,
      "stepTag":"metaphas-1363216411001",
      "runStatus":"complete",
      "remoteServerName":"2478",
      "activeFlag":"Y",
      "processInstanceRunId":0,
      "stepOutputType":1,
      "companyId":0,
      "stepId":1232,
      "stepType":"step"
   }
]

Back to top

/processinstance/{id}/processtargets 

Description

Gets the servers on which a particular process was run.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/processtargets?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8263/processtargets?access_token=nvk7QZGTybCKItXCb4XTxXGqt&runid=47396&processcode=SCRIPT1

Method

GET

Parameters

Name Required or Optional
runid Required
processcode Optional

Sample response:

[  
   {  
      "nodeId":2478,
      "activeFlag":"Y",
      "description":"",
      "nodeAttrList":[  

      ],
      "nodeName":"ubuntu1204-ms-sx5",
      "agentId":2478,
      "attrHash":{  

      },
      "companyId":0,
      "tagList":[  

      ],
      "osn":"Linux"
   },
   {  
      "nodeId":2515,
      "activeFlag":"Y",
      "description":"",
      "nodeAttrList":[  

      ],
      "nodeName":"test-zss1-db",
      "agentId":2515,
      "attrHash":{  

      },
      "companyId":0,
      "tagList":[  

      ],
      "osn":"Linux"
   }
]

Back to top

/processinstance/{id}/targets 

Description

Gets the servers on which the whole process was run.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<jobid>/targets?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8263/targets?access_token=nvk7QZGTybCKItXCb4XTxXGqt

Method

GET

Sample response:

[  
   {  
      "nodeId":2478,
      "activeFlag":"Y",
      "description":"",
      "nodeAttrList":[  

      ],
      "nodeName":"ubuntu1204-ms-sx5",
      "agentId":2478,
      "attrHash":{  

      },
      "companyId":0,
      "tagList":[  

      ],
      "osn":"Linux"
   },
   {  
      "nodeId":2515,
      "activeFlag":"Y",
      "description":"",
      "nodeAttrList":[  

      ],
      "nodeName":"test-zss1-db",
      "agentId":2515,
      "attrHash":{  

      },
      "companyId":0,
      "tagList":[  

      ],
      "osn":"Linux"
   }
]

Back to top

/processinstance/{id}/pause 

Description

Pauses a job.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/pause?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8267/pause?access_token=nvk7QZGTybCKItXCb4XTxXGqt

Method

GET

Parameters

jobid (required)

Sample response:

{  
   "actionGroupId":0,
   "targetGroupId":0,
   "jobId":8267,
   "targetDetailBeans":[  

   ],
   "parentJobId":0,
   "role":"Admin",
   "companyId":40034,
   "tagList":[  

   ],
   "serverGroups":[  

   ],
   "user":"",
   "scheduleBeans":[  

   ]
}

Back to top

/processinstance/{id}/resume 

Description

Pauses a job.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/resume?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8267/resume?access_token=nvk7QZGTybCKItXCb4XTxXGqt

Method

GET

Parameters

jobid (required)

Sample response:

{  
   "actionGroupId":0,
   "targetGroupId":0,
   "jobId":8267,
   "targetDetailBeans":[  

   ],
   "parentJobId":0,
   "role":"Admin",
   "companyId":40034,
   "tagList":[  

   ],
   "serverGroups":[  

   ],
   "user":"",
   "scheduleBeans":[  

   ]
}

Back to top

/processinstance/{id}/cancel 

Description

Cancels a job.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/cancel?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8267/cancel?access_token=nvk7QZGTybCKItXCb4XTxXGqt

Method

GET

Parameters

jobid (required)

Sample response:

{  
   "actionGroupId":0,
   "targetGroupId":0,
   "jobId":8267,
   "targetDetailBeans":[  

   ],
   "parentJobId":0,
   "role":"Admin",
   "companyId":40034,
   "tagList":[  

   ],
   "serverGroups":[  

   ],
   "user":"",
   "scheduleBeans":[  

   ]
} 

Back to top

/processinstance/{id}/pauserun 

Description

Pauses a run.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/pauserun?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8267/pauserun?access_token=nvk7QZGTybCKItXCb4XTxXGqt

Method

GET

Parameters

runid (required)

Sample response:

{  
   "processInstanceRunBeans":[  

   ],
   "jobId":8267,
   "taskPropertyBeans":[  

   ],
   "role":"Admin",
   "jobRunOutputBeans":[  

   ],
   "companyId":40034,
   "runId":47613,
   "projectId":0,
   "user":"10087",
   "runTimestamp":0
}

Back to top

/processinstance/{id}/resumerun 

Description

Resumes a run.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/resumerun?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8267/resumerun?access_token=nvk7QZGTybCKItXCb4XTxXGqt

Method

GET

Parameters

runid (required)

Sample response:

{  
   "processInstanceRunBeans":[  

   ],
   "jobId":8267,
   "taskPropertyBeans":[  

   ],
   "role":"Admin",
   "jobRunOutputBeans":[  

   ],
   "companyId":40034,
   "runId":47613,
   "projectId":0,
   "user":"10087",
   "runTimestamp":0
}

Back to top

/processinstance/{id}/cancelrun 

Description

Cancels a run.

URL structure

httpsː//smart.cloud.com/v0/processinstance/<id>/cancelrun?access_token=<valid token generated by authentication>

URL example

httpsː//smart.cloud.com/v0/processinstance/8267/cancelrun?access_token=nvk7QZGTybCKItXCb4XTxXGqt

Method

GET

Parameters

runid (required)

Sample response:

{  
   "processInstanceRunBeans":[  

   ],
   "jobId":8267,
   "taskPropertyBeans":[  

   ],
   "role":"Admin",
   "jobRunOutputBeans":[  

   ],
   "companyId":40034,
   "runId":47613,
   "projectId":0,
   "user":"10087",
   "runTimestamp":0
}

Back to top

0 Comments