cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Community Helping Community

1793
Views
0
Helpful
8
Replies
Beginner

Using Cisco Tidal REST APIs

Hi,

 

I want to get job status using Tidal REST API, so we are using JobRun.get API as below:

https://servername/api/sname/JobRun.get/111111111

where 111111111 is job number. Using this we are getting required information.

But problem is job number is dynamic and we are manually getting it from Tidal Web UI.

Question is how to get job status using Job name instead of Job number? Or is there any way to get dynamic job number using job name?

 

regards

Santosh.

8 REPLIES 8
Participant

This discussion has been

This discussion has been reposted from Additional Communities to the Tidal Enterprise Scheduler community.

Beginner

Here's 2 examplesone to grab

Here's 2 examples

  1. one to grab select columns by jobmst_alias
  2. one to grab everything by jobmst_id

one special thing to note is that you don't need to tag items in query conditions.

I'm working on a more comprehensive guide as  I think I have finally figured all this out...

Marc

 

Assumptions

Given a jobrun in the schedule

jobmst_id = 19990

jobmst_alias='REST1'

 

select columns rundate, alias by jobmst_alias

<entry xmlns="http://purl.org/atom/ns#">
 <tes:JobRun.get xmlns:tes="http://www.tidalsoftware.com/client/tesservlet">
  <id></id>
  <selectColumns>rundate, alias</selectColumns>
  <queryCondition>alias='REST1'</queryCondition>
 </tes:JobRun.get>
</entry>

 

one to grab everything by jobmst_id

<entry xmlns="http://purl.org/atom/ns#">
 <tes:JobRun.get xmlns:tes="http://www.tidalsoftware.com/client/tesservlet">
  <id></id>
  <selectColumns></selectColumns>
  <queryCondition>jobid=19990</queryCondition>
 </tes:JobRun.get>
</entry>

Beginner

Hi Marc - I am very

Hi Marc - I am very interested in your guide if you are willing to share when you get it completed. 

 

I currently have a requirement that our ticketing system (ServiceNow) connect to Tidal and issue a reboot set of jobs.  What needs to happen is the Agent on the group job changes to the one passed by ServiceNow, but since a job action doesn't allow a variable in the agent field, I'm stumped.

 

Thank you!

Michelle Morris

 

Beginner

Nice Challenge.... well you

Nice Challenge.... well you can't do it with 1 step... at least not without a script or workflow in servicenow... which when you get that far... let me know as I am interested in the servicenow integration down the road ... we are just starting to implement here (my new job).

 

In the use case you outlined you have to take a multiple step approach (could possibly be scripted with something like PowerShell, ServiceNow Workflow, etc.).

I executed this and it does work manually

Marc

 

Requirements

  1. Need to know jobmst_id of target job/jobgroup in this case 20072

  2. Must add “require operator release” setting

  3. Must be able to query for latest jobrun_id and use in downstream REST calls

Desired Outcomes

  1. I want to force a run on Agent XYZ nodmst_id = 117 for this particular run

  2. I want to add different parameters for override (add a variable)

  3. I want to execute with the changes above automatically

 

  1. Caveat: you can’t change the agent on insert via GUI, this make the job/jobgroup have to have “require operator release” setting

  2. Caveat: you have to specify all parameters as it will put in a blank parameter screen by default… this seems like a defect to me (GUIs will insert the params from the definition and allow you to override but not REST job.insert method)

 

Step 1 insert the job on operator release

 

<?xml version="1.0" encoding="UTF-8"?>

<entry xmlns="http://purl.org/atom/ns#">

           <tes:Job.insert xmlns:tes="http://www.tidalsoftware.com/client/teservlet">

                     <tes:id>20072</tes:id>

                     <tes:params>Write-Output &apos;&lt;JobParent&gt;\&lt;JobName&gt; runs on &lt;ALIAS_TidalSql.118&gt; my new Params&apos;</tes:params>

                     <tes:startdate>20150910</tes:startdate>

           </tes:Job.insert>

</entry>

 

Step 2 Obtain the latest jobrun_id for target jobmst_id

 

Must get jobrun_id to manipulate the job using REST here’s where the process might break for you  unless you can write a query to get the “max” run :  SELECT MAX(jobrun_id) FROM jobrun WHERE jobmst_id = 20072

In this case the jobrunid/id =  669920

 

Step 3 Modify job in job activity and switch agents

 

In this case say I wanted to Switch Agent List (definition) to Specific Agent 117 so I have to run a jobrun.update method

 

<?xml version="1.0" encoding="UTF-8" ?>

<entry xmlns="http://purl.org/atom/ns#">

           <tes:JobRun.update xmlns:tes="http://www.tidalsoftware.com/client/tesservlet">

                     <object>

                                <tes:id>669920</tes:id>

                                <tes:nodeid>117</tes:nodeid>

                     </object>

           </tes:JobRun.update>

</entry>

 

Step 3 Release job

<?xml version="1.0" encoding="UTF-8" ?>

<entry xmlns="http://purl.org/atom/ns#">

           <tes:JobRun.release xmlns:tes="http://www.tidalsoftware.com/client/tesservlet">

                     <id>669920</id>

           </tes:JobRun.release>

</entry>

 

That's it..

Beginner

Marc - It appears there is

Marc - It appears there is not an update method for the JobRun:

Method [update] does not exist for type [com.tidalsoft.scheduler.api.objects.impl.JobRun].

 

but...

 

If I wrap my job in a job group, I can edit the agent at the group level.  Then, with the agent inherited in the job I can insert the group and the job runs on the correct agent!

 

Thank you so much for helping me get started on this.  I will definitely let you know how we end up integrating this.

 

Here are the two steps:

Edit the agent at the group level:

<?xml version="1.0" encoding="UTF-8"?>

<entry xmlns="http://purl.org/atom/ns#">

<id>3</id>

<tes:JobGroup.update xmlns:tes="http://www.tidalsoftware.com/client/tesservlet">

<tes:jobgroup>

<tes:id>20185</tes:id>

<tes:type>1</tes:type>

<tes:agentid>1660</tes:agentid>

</tes:jobgroup>

</tes:JobGroup.update>

</entry>

 

 

Insert job group

<?xml version="1.0" encoding="UTF-8"?>

<entry xmlns="http://purl.org/atom/ns#">

           <tes:Job.insert xmlns:tes="http://www.tidalsoftware.com/client/teservlet">

                     <tes:id>20185</tes:id>

                     <tes:startdate>20150911</tes:startdate>

           </tes:Job.insert>

</entry>

 

Beginner

Re: Using Cisco Tidal REST APIs

@santoshtupe1 Did u get to solve  this. I am facing the same issue.

Cisco Employee

Re: Using Cisco Tidal REST APIs

What Tidal product are you referring to?

If it's Cisco Process Orchestrator, I might be able to help.  What issue did you run into?

Highlighted
Beginner

Re: Using Cisco Tidal REST APIs

Hi @Tuan Tran,

                       I am trying to use  API for Tidal Enterprise Scheduler version 6.0 Web API. I was able to insert a job into schedule. But, I couldn't pull the jobrunid of the running job to pull its status. How can I pull the status of the running job.

Thank you.

Best,

Chinmayi Injam. 

        

CreatePlease to create content
Content for Community-Ad
FusionCharts will render here
This widget could not be displayed.