Script gnt_job
[hide private]
[frames] | no frames]

Script gnt_job

Functions [hide private]
int
ListJobs(opts, args)
List the jobs
int
ArchiveJobs(opts, args)
Archive jobs.
int
AutoArchiveJobs(opts, args)
Archive jobs based on age.
int
CancelJobs(opts, args)
Cancel not-yet-started jobs.
int
ShowJobs(opts, args)
Show detailed information about jobs.
int
WatchJob(opts, args)
Follow a job and print its output as it arrives.
Variables [hide private]
  _LIST_DEF_FIELDS = ["id", "status", "summary"]
  _USER_JOB_STATUS = {constants.JOB_STATUS_QUEUED: "queued", con...
  commands = {'list':(ListJobs, ARGS_ANY, [DEBUG_OPT, NOHDR_OPT,...

Imports: sys, constants, errors, utils, cli


Function Details [hide private]

ListJobs(opts, args)

 

List the jobs

Parameters:
  • opts - the command line options selected by the user
  • args (list) - should be an empty list
Returns: int
the desired exit code

ArchiveJobs(opts, args)

 

Archive jobs.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - should contain the job IDs to be archived
Returns: int
the desired exit code

AutoArchiveJobs(opts, args)

 

Archive jobs based on age.

This will archive jobs based on their age, or all jobs if a 'all' is passed.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - should contain only one element, the age as a time spec that can be parsed by ganeti.cli.ParseTimespec or the keyword all, which will cause all jobs to be archived
Returns: int
the desired exit code

CancelJobs(opts, args)

 

Cancel not-yet-started jobs.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - should contain the job IDs to be cancelled
Returns: int
the desired exit code

ShowJobs(opts, args)

 

Show detailed information about jobs.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - should contain the job IDs to be queried
Returns: int
the desired exit code

WatchJob(opts, args)

 

Follow a job and print its output as it arrives.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - Contains the job ID
Returns: int
the desired exit code

Variables Details [hide private]

_USER_JOB_STATUS

Value:
{constants.JOB_STATUS_QUEUED: "queued", constants.JOB_STATUS_WAITLOCK:\
 "waiting", constants.JOB_STATUS_CANCELING: "canceling", constants.JOB\
_STATUS_RUNNING: "running", constants.JOB_STATUS_CANCELED: "canceled",\
 constants.JOB_STATUS_SUCCESS: "success", constants.JOB_STATUS_ERROR: \
"error",}

commands

Value:
{'list':(ListJobs, ARGS_ANY, [DEBUG_OPT, NOHDR_OPT, SEP_OPT, FIELDS_OP\
T], "[job_id ...]", "List the jobs and their status. The available fie\
lds are" " (see the man page for details): id, status, op_list," " op_\
status, op_result." " The default field" " list is (in order): %s." % \
", ".join(_LIST_DEF_FIELDS)), 'archive':(ArchiveJobs, ARGS_ANY, [DEBUG\
_OPT], "<job-id> [<job-id> ...]", "Archive specified jobs"), 'autoarch\
ive':(AutoArchiveJobs, ARGS_ONE, [DEBUG_OPT], "<age>", "Auto archive j\
obs older than the given age"), 'cancel':(CancelJobs, ARGS_ANY, [DEBUG\
...