Network Change & Configuration Management

Reply
Highlighted
Accepted Solution

How to Schedule a Job in Net MRI?

Authority
Posts: 41
7285     0

I'm writing a script in Net MRI for scheduled Job on certain devices.

 

So far I have created a script and retrieved jobID. I have to schedule it for a futuristic date.

Can someone help me which broker method is useful?

 

I have been digging API docs for various methods

exp

my $job = $client->broker->job->show({JobID => $job_id})->{job}; 

 

All the given broker methods are for index,search and find with some matching input my question is how do I set the time?

 

Please advise.

Nidhi

Re: How to Schedule a Job in Net MRI?

Adviser
Posts: 357
7286     0
Look at JobSpecification. That defines the job schedule, script, parameters, etc., whereas the Job model tracks actual runs of that specification.

Re: How to Schedule a Job in Net MRI?

[ Edited ]
Authority
Posts: 41
7286     0

Hi John

 

I really appreciate your pormpt reply. You have been such a great help.

thanks again!

 

Can you look into my  error please shich i'm getting by creating a job

 I ran my script I got following error
SERVER general/record-not-found Couldn't find Script with name = ‘Name of the script’//xyz.com/api/3/scripts/run.json at script.pl line 104

I followed the same refrence  as below


my $script_name = "Any given name";

 

my $job_id = $client->broker->script->run({
name => $script_name,
device_ids => $device_id,
'$commnad' => 'show version',
})->{JobID};

 

Please advice

Nidhi

Re: How to Schedule a Job in Net MRI?

Authority
Posts: 41
7286     0

Hi John,

 

 I have successfully created a Job specifications dn the script is doing great. This time I'm creating the same thing but with a extremely large number of commands (Configuration file) to be executed.

its creating a job but I noticed the Commands are cut off.

 

I looked into the API but couldn't find any specification with the pagination or limit for line number?

Can you please advice.

 

Commands to executed = "very long configuration file....."

Its being cut off in between.

 

Please advise.

 

-Nidhi 

Showing results for 
Search instead for 
Do you mean 

Recommended for You