Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-ganeti
Commits
917b4e56
Commit
917b4e56
authored
16 years ago
by
Iustin Pop
Browse files
Options
Downloads
Patches
Plain Diff
Documentation updates for gnt-job
Reviewed-by: imsnah
parent
48de3413
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/gnt-job
+48
-1
48 additions, 1 deletion
scripts/gnt-job
with
48 additions
and
1 deletion
scripts/gnt-job
+
48
−
1
View file @
917b4e56
...
...
@@ -30,8 +30,11 @@ from ganeti import constants
from
ganeti
import
errors
#: default list of fields for L{ListJobs}
_LIST_DEF_FIELDS
=
[
"
id
"
,
"
status
"
,
"
summary
"
]
#: map converting the job status contants to user-visible
#: names
_USER_JOB_STATUS
=
{
constants
.
JOB_STATUS_QUEUED
:
"
queued
"
,
constants
.
JOB_STATUS_WAITLOCK
:
"
waiting
"
,
...
...
@@ -45,6 +48,12 @@ _USER_JOB_STATUS = {
def
ListJobs
(
opts
,
args
):
"""
List the jobs
@param opts: the command line options selected by the user
@type args: list
@param args: should be an empty list
@rtype: int
@return: the desired exit code
"""
if
opts
.
output
is
None
:
selected_fields
=
_LIST_DEF_FIELDS
...
...
@@ -105,6 +114,15 @@ def ListJobs(opts, args):
def
ArchiveJobs
(
opts
,
args
):
"""
Archive jobs.
@param opts: the command line options selected by the user
@type args: list
@param args: should contain the job IDs to be archived
@rtype: int
@return: the desired exit code
"""
client
=
GetClient
()
for
job_id
in
args
:
...
...
@@ -114,6 +132,20 @@ def ArchiveJobs(opts, args):
def
AutoArchiveJobs
(
opts
,
args
):
"""
Archive jobs based on age.
This will archive jobs based on their age, or all jobs if a
'
all
'
is
passed.
@param opts: the command line options selected by the user
@type args: list
@param args: should contain only one element, the age as a time spec
that can be parsed by L{cli.ParseTimespec} or the keyword I{all},
which will cause all jobs to be archived
@rtype: int
@return: the desired exit code
"""
client
=
GetClient
()
age
=
args
[
0
]
...
...
@@ -128,6 +160,15 @@ def AutoArchiveJobs(opts, args):
def
CancelJobs
(
opts
,
args
):
"""
Cancel not-yet-started jobs.
@param opts: the command line options selected by the user
@type args: list
@param args: should contain the job IDs to be cancelled
@rtype: int
@return: the desired exit code
"""
client
=
GetClient
()
for
job_id
in
args
:
...
...
@@ -137,7 +178,13 @@ def CancelJobs(opts, args):
def
ShowJobs
(
opts
,
args
):
"""
List the jobs
"""
Show detailed information about jobs.
@param opts: the command line options selected by the user
@type args: list
@param args: should contain the job IDs to be queried
@rtype: int
@return: the desired exit code
"""
def
format
(
level
,
text
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment