Predicted Duration Commands
This page includes the following:
add_predicted_duration()
Add a new predicted duration for a job.
Parameters:
-
job_name- name of the job to create a predicted duration for -
duration- predicted duration in milliseconds -
scheduler(optional) - name of the scheduler containing the job (required if more than one scheduler is defined)Default: None
-
description(optional) - recommended to be name of algorithm used to calculate predicted durationDefault: None
-
expiration_date(optional) - date/time that the predicted duration should be used until, in the format understood by parse_date() ('2007/1/15 13:21:00 MST')Default: None - never expire predicted duration for this job, see parse_date()
Dependencies:
- Must be logged in as admin
Result:
- New predicted duration added for specified job
Example add_predicted_duration() command line usage:
>>> add_predicted_duration(job_name='h_prices_fw', duration=45000,
scheduler='tidal53', description='new duration',
expiration_date='2015/7/10 12:00:00 MDT')
done
Example add_predicted_duration() script usage:
import sys
from jaws import *
login()
print 'begin'
try:
add_predicted_duration(job_name='h_prices_fw', duration=45000,
scheduler='tidal53', description='new duration',
expiration_date='2015/8/22 12:00:00 MDT')
print 'end'
finally:
logout()
delete_predicted_duration()
Delete an existing predicted duration for a job.
Parameters:
-
job_name- name of the job to delete predicted duration for -
scheduler(optional) - name of the scheduler containing the job (required if more than one scheduler is defined)Default: None
Dependencies:
- Must be logged in as admin
Result:
- Existing predicted duration deleted for specified job
Example delete_predicted_duration() command line usage:
>>> delete_predicted_duration(job_name='e-eom-cleanup-bat',
scheduler='autosysR11-02')
done
Example delete_predicted_duration() script usage:
import sys
from jaws import *
login()
print 'begin'
try:
pred = predicted_durations()
for p in pred:
delete_predicted_duration(p.job(), p.scheduler())
print 'end'
finally:
logout()
predicted_duration()
Get a predicted duration for the specified job_name, scheduler.
Parameters:
-
job_name- name of the job to get predicted duration for -
scheduler(optional) - name of the scheduler containing the job (required if more than one scheduler is defined)Default: None
Dependencies:
- Must be logged in
Result:
- A Predicted Duration object representing the predicted duration or None if none exists ,see Predicted Duration.
Example predicted_duration() command line usage:
>>> predicted_duration(job_name='e-eom-cleanup-bat',
scheduler='autosysR11-02')
<predicted duration: e-eom-cleanup-bat/autosysR11-02; 45; None>
Example predicted_duration() script usage:
import sys
from jaws import *
login()
print 'begin'
try:
dur = predicted_duration(job_name='h_prices_fw',
scheduler='tidal53')
print 'job: ' + dur.job()
print ' scheduler: ' + dur.scheduler()
print ' description: ' + dur.description()
print ' duration: ' + str(dur.duration())
print ' expiration time: ' + dur.expirationTime()
print 'end'
finally:
logout()
predicted_durations()
Get all of the user defined predicted durations
Parameters:
- None
Dependencies:
- Must be logged in
Result:
- A list of Predicted Duration objects representing each predicted duration or None if none exists, see Predicted Duration.
Example predicted_durations() command line usage:
>>> predicted_durations()
Predicted durations found: 2
[<predicted duration: e-eom-cleanup-bat/autosysR11-02; 45; None>,
<predicted duration: e_som_imprtfx_bat/CLI - API - cm03;
10:00:00; second duration>]
Example predicted_durations() script usage:
import sys
from jaws import *
login()
print 'begin'
try:
pred = predicted_durations()
for p in pred:
print 'job: ' + p.job()
print ' scheduler: ' + p.scheduler()
print ' description: ' + p.description()
print ' duration: ' + str(p.duration())
print ' expiration time: ' + p.expirationTime()
print 'end'
finally:
logout()
update_predicted_duration()
Update an existing predicted duration for a job.
Parameters:
-
job_name- name of the job to update predicted duration for -
duration- new predicted duration in milliseconds -
scheduler(optional) - name of the scheduler containing the job (required if more than one scheduler is defined)Default: None
-
description(optional) - recommended to be name of algorithm used to calculate predicted durationDefault: None
-
expiration_date(optional) - date/time that the predicted duration should be used until, in the format understood by parse_date() ('2007/1/15 13:21:00 MST')Default: None - never expire predicted duration for this job, see parse_date()
Dependencies:
- Must be logged in as admin
Result:
- Existing predicted duration updated for given job
Example update_predicted_duration() command line usage:
>>> update_predicted_duration(job_name='e-eom-cleanup-bat',
duration=60000, scheduler='autosysR11-02', description='updated',
expiration_date='2015/6/30 12:00:00 MDT')
done
Example update_predicted_duration() script usage:
import sys
from jaws import *
login()
print 'begin'
try:
update_predicted_duration(job_name='d_mrn_dst_scp',
duration=60000, scheduler='CLI - API - cm03', description='updated',
expiration_date='2015/8/22 10:30:00 MDT')
print 'end'
finally:
logout()