Junos Space Developer
Reply
Contributor
sonika
Posts: 19
Registered: ‎10-07-2011
0

Re: Regarding Job Management framework

Hi Vimala,

 

Please have a look at the attached document.

 

Regards, Sonika

Super Contributor
vimala.srinivasa
Posts: 209
Registered: ‎10-07-2010
0

Re: Regarding Job Management framework

Document missing ?

Contributor
sonika
Posts: 19
Registered: ‎10-07-2011
0

Re: Regarding Job Management framework

Please find the document.

Super Contributor
vimala.srinivasa
Posts: 209
Registered: ‎10-07-2010
0

Re: Regarding Job Management framework

Hi Sonika,

 

   I tested the same scenario which you had mentioned in the document.   You can use the job management REST API and monitor the tag recurring.  When you schdule the repetitive job the recurrence will be set to true.   You can take a look at the output which i have pasted below for your reference.

 

    We create new job id each time for every 2 minutes schduled. 

 

 

 http://116.197.179.20:8080/api/space/job-management/jobs

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><jobs size="19" uri="/api/space/job-management/jobs"><job key="98304" uri="/api/space/job-management/jobs/98304" href="/api/space/job-management/jobs/98304"><name>Add Application-98304</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="98305" uri="/api/space/job-management/jobs/98305" href="/api/space/job-management/jobs/98305"><name>Add Application-98305</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="98306" uri="/api/space/job-management/jobs/98306" href="/api/space/job-management/jobs/98306"><name>Add Application-98306</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196608" uri="/api/space/job-management/jobs/196608" href="/api/space/job-management/jobs/196608"><name>Add Application-196608</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196609" uri="/api/space/job-management/jobs/196609" href="/api/space/job-management/jobs/196609"><name>Add Application-196609</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196610" uri="/api/space/job-management/jobs/196610" href="/api/space/job-management/jobs/196610"><name>Add Application-196610</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196611" uri="/api/space/job-management/jobs/196611" href="/api/space/job-management/jobs/196611"><name>Add Application-196611</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196612" uri="/api/space/job-management/jobs/196612" href="/api/space/job-management/jobs/196612"><name>Add Application-196612</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196613" uri="/api/space/job-management/jobs/196613" href="/api/space/job-management/jobs/196613"><name>Add Application-196613</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196614" uri="/api/space/job-management/jobs/196614" href="/api/space/job-management/jobs/196614"><name>Add Application-196614</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196615" uri="/api/space/job-management/jobs/196615" href="/api/space/job-management/jobs/196615"><name>Discover Network Elements-196615</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196617" uri="/api/space/job-management/jobs/196617" href="/api/space/job-management/jobs/196617"><name>Discover Network Elements-196617</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196619" uri="/api/space/job-management/jobs/196619" href="/api/space/job-management/jobs/196619"><name>Edit Configuration-196619</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196620" uri="/api/space/job-management/jobs/196620" href="/api/space/job-management/jobs/196620"><name>Resync Network Elements-196620</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196622" uri="/api/space/job-management/jobs/196622" href="/api/space/job-management/jobs/196622"><name>Resync Network Elements-196622</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196624" uri="/api/space/job-management/jobs/196624" href="/api/space/job-management/jobs/196624"><name>Resync Network Elements-196624</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196626" uri="/api/space/job-management/jobs/196626" href="/api/space/job-management/jobs/196626"><name>Resync Network Elements-196626</name><state>DONE</state><status>SUCCESS</status><recurring>false</recurring></job><job key="196628" uri="/api/space/job-management/jobs/196628" href="/api/space/job-management/jobs/196628"><name>Backup Configuration Files-196628</name><state>DONE</state><status>SUCCESS</status><recurring>true</recurring></job><job key="196629" uri="/api/space/job-management/jobs/196629" href="/api/space/job-management/jobs/196629"><name>Backup Configuration Files-196629</name><state>SCHEDULED</state><status>UNDETERMINED</status><recurring>true</recurring></job></jobs>

 

When you get individual job id it would give you complete details with time in the recurrence tag


 http://116.197.179.20:8080/api/space/job-management/jobs/196631

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><job uri="/api/space/job-management/jobs/196631"><id>196631</id><name>Backup Configuration Files-196631</name><percent>0.0</percent><status>UNDETERMINED</status><jobType>Backup Configuration Files</jobType><scheduledStartTime>Thu, 03 Nov 2011 07:30:00 GMT</scheduledStartTime><user>super</user><recurrence>Every 2 minutes Starts: Thu, 03 Nov 2011 07:26:00 GMT Ends by: Fri, 04 Nov 2011 07:26:00 GMT</recurrence><progress-update href="/api/space/job-management/jobs/196631/progress-update"/></job>

 

You can't cancel the job which says the state with "SUCCESS" but what you can do is monitor the new job which is in "SCHDULED" state then the user will be able to cancel it will stop the job complete.

 

I hope this clears the understanding .  Let me know if you have any more queries. 

 

 

 

Thanks,

 

Vimala.

  

 

   

Contributor
sonika
Posts: 19
Registered: ‎10-07-2011
0

Re: Regarding Job Management framework

Hi Vimala,

 

Thanks for reply. From job management rest API, I can get all jobs detail or elaborate detail of one job. But my requirement is different.

 

I dont have the id to get job detail . The ID of job which is created for recurrent execution.

 

How to get that?

 

Is it possible for you to have a discussion on call if you can share some number where I can explain you more.

 

Regards,

Sonika

Super Contributor
vimala.srinivasa
Posts: 209
Registered: ‎10-07-2010
0

Re: Regarding Job Management framework

Sure Sonika,  send me a test mail to my id vimalas@juniper.net then i will send out the bridge details for afternoon 2PM.  

 

 

Contributor
sonika
Posts: 19
Registered: ‎10-07-2011
0

Re: Regarding Job Management framework

Hi Vimala,

 

I have sent you a test mail.

 

Regards,

Sonika

Super Contributor
vimala.srinivasa
Posts: 209
Registered: ‎10-07-2010
0

Re: Regarding Job Management framework

Hi Sonika,

 

     Thank you very much for the call.  Right now we dont have the functionality were we can corelate all the recurrence job id's for a schduled time to one parent job id.  We always create new job id's for every new recurrence task so for now you can only monitor for status, task name and recurrence details to identify the job type and id.

 

      I will raise an enhancement request to see if we can get this supported and update you accordingly. 

 

 

Thanks,

 

Vimala.

Contributor
sonika
Posts: 19
Registered: ‎10-07-2011
0

Re: Regarding Job Management framework

Hi Vimala,

 

Thanks for your time. We were looking for the work around as this enhancement implementation is going to take time.

 

I think I can use "Name" field of Job record to put some identification string e.g. "Bakcup configuration Files - device192.1681.1.".

 

In this way I will be able to corelare recurrence jobs with parent job.

 

Can you please tell me the way to set this "Name" field.

 

Regards,

Sonika

Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.