You can use the Jython scripting language to configure
and manage administrative jobs with the wsadmin tool.
Use the following commands to manage administrative jobs
for the job manager:
deleteJob
The
deleteJob command deletes an existing job from the job manager. If
the job is running when you invoke the command, the system still
returns the job results whether or not the job is deleted.
Target object
None.
Required parameters
- -jobToken
- Specifies the unique identifier of the job to delete. (String,
required)
Return value
The
command does not return output.
Batch
mode example usage
- Using Jython string:
AdminTask.deleteJob('-jobToken myToken')
- Using Jython list:
AdminTask.deleteJob('-jobToken', 'myToken')
Interactive mode example usage
- Using Jython:
AdminTask.deleteJob('-interactive')
getJobTargets
The
getJobTargets command displays the target for a job of interest. The
target that the command returns for a job might be unenrolled or
deleted.
Target object
None.
Required parameters
- -jobToken
- Specifies the unique identifier of the job of interest. (String,
required)
Return value
The
command returns the node name for the targets for the job of interest.
Batch mode example usage
- Using Jython string:
AdminTask.getJobTargets('-jobToken myToken')
- Using Jython list:
AdminTask.getJobTargets('-jobToken', 'myToken')
Interactive mode example usage
- Using Jython:
AdminTask.getJobTargets('-interactive')
getJobTargetStatus
The
getJobTargetStatus command displays the most recent job target status
for the job of interest.
Target object
None.
Required parameters
- -jobToken
- Specifies the unique identifier of the job of interest. (String,
required)
Optional parameters
- -targetList
- Specifies a list of target node names. (String [ ], optional)
Return value
The
command returns the most recent job status for the targets. The status
might be: NOT_ATTEMPTED, DISTRIBUTED, ASYNC_IN_PROGRESS, SUCCEEDED,
PARTIALLY_SUCCEEDED, FAILED, DELAYED, or REJECTED.
Batch mode example usage
- Using Jython string:
AdminTask.getJobTargetStatus('-jobToken myToken')
- Using Jython list:
AdminTask.getJobTargetStatus('-jobToken', 'myToken')
Interactive mode example usage
- Using Jython:
AdminTask.getJobTargetStatus('-interactive')
getJobTargetHistory
The
getJobTargetHistory command displays the job target history for the
job of interest.
Target object
None.
Required parameters
- -jobToken
- Specifies the unique identifier of the job of interest. (String,
required)
- -target
- Specifies the node name of the target of interest. (String, required)
- -maxReturn
- Specifies the maximum number of results to return. (Integer, required)
Optional parameters
- -startingTime
- Specifies the time from which the command returns the job target
history. (String, optional)
- -endingTime
- Specifies the time at which the command stops returning the job
target history. (String, optional)
- -ascending
- Specifies whether to return the results in ascending or descending
order. Specify true to display the results in ascending
order, or specify false to display the results in descending
order. (Boolean, optional)
Return value
The
command returns a list of attributes, where the first attribute specifies
the number of matches, and the second attribute specifies the history
of the job on the target. Each list contains the timestamp, status,
message, and result attributes.
Batch
mode example usage
- Using Jython string:
AdminTask.getJobTargetHistory('-jobToken 2846493472984754 -target 3820J37H3017N294
-maxReturn 20')
- Using Jython list:
AdminTask.getJobTargetHistory('-jobToken', '2846493472984754', '-target',
'3820J37H3017N294', '-maxReturn', '20')
Interactive mode example usage
- Using Jython :
AdminTask.getJobTargetHistory('-interactive')
getJobTypes
The
getJobTypes command displays the supported job types for an endpoint
of interest.
Target object
None.
Optional parameters
- -targetList
- Specifies a list of node names for the target. (String [ ], optional)
- -group
- Specifies the name of the group for the target. (String, optional)
Return value
The
command returns a list of job types that each specified target supports.
Batch mode example usage
- Using Jython string:
AdminTask.getJobTypes('-target myProfileKey')
- Using Jython list:
AdminTask.getJobTypes('-target', 'myProfileKey')
Interactive mode example usage
- Using Jython:
AdminTask.getJobTypes('-interactive')
getJobTypeMetadata
The
getJobTypeMetadata command displays the metadata that is associated
with a specific job type.
Target object
None.
Required parameters
- -jobTypeList
- Specifies a list of job types of interest. (String [ ], optional)
Return value
The
command returns a list of attributes, including the name, label, description, job-properties,
and job-parameters attributes.
Batch
mode example usage
- Using Jython string:
AdminTask.getJobTypeMetadata('-jobTypeList inventory')
- Using Jython list:
AdminTask.getJobTypeMetadata('-jobTypeList', 'inventory')
Interactive mode example usage
- Using Jython:
AdminTask.getJobTypeMetadata('-interactive')
getOverallJobStatus
The
getOverallJobStatus command displays the overall job status for a
specific job or a list of jobs of interest.
Target object
None.
Optional parameters
- -jobTokenList
- Specifies a one or more of the unique identifiers of the jobs
of interest. (String [ ], optional)
Return value
The
command returns job status information for the job or jobs of interest.
The REJECTED attribute specifies the number of jobs that the job manager
rejected and did not run. The system displays the following information
in the overall job status:
- The STATE attribute specifies the current state of the
job.
- The TOTAL_RESULTS attribute specifies the total number
of jobs.
- The DISTRIBUTED attribute specifies the number of distributed
jobs.
- The ASYNC_IN_PROGRESS attribute specifies the number
of asynchronous jobs in progress.
- The SUCCEEDED attribute specifies the number of successful
jobs.
- The PARTIALLY_SUCCEEDED attribute specifies the number
of partially completed jobs. For example, partial success might occur
when a node represents multiple servers, and only some of the servers
on the node complete the job successfully.
- The FAILED attribute specifies the number of failed jobs
- The NOT_ATTEMPTED attribute specifies the number of jobs
that the system has not attempted.
Batch mode example usage
- Using Jython string:
AdminTask.getOverallJobStatus('-jobTokenList myJobToken')
- Using Jython list:
AdminTask.getOverallJobStatus('-jobTokenList', 'myJobToken')
Interactive mode example usage
- Using Jython:
AdminTask.getOverallJobStatus('-interactive')
queryJobs
The
queryJobs command queries the job manager for each submitted job.
Target object
None.
Required parameters
- -query
- Specifies the search expression to use to query for jobs. (String,
required)
Use the following guidelines when creating your job queries:
- The query consists of a key, operator, and value, or a list of
values. You can specify a single value or a list of values separated
by a comma.
- Separate multiple expressions with a space and the AND operator.
- The following case sensitive keys are supported:
- jobToken
- Specifies the job token for a specific job to query.
- group
- Specifies the node group name to query.
- description
- Specifies the description of the job to query. If the description
contains multiple words, format the description in single or double
quotes such as description = "job description".
- activationDateTime
- Specifies the date and time that the system activates the job,
such as 2006-05-03T10:30:45-0000. The -0000 section
of the activationDateTime key value represents RFC 822 format. You
can specify Z as a shortcut for Greenwich Mean Time (GMT),
such as 2006-05-03T10:30:45Z. If you do not specify the
time zone, the system uses the time zone of the server.
- expirationDateTime
- Specifies the date and time that the job expires, such as 2006-05-03T10:30:45-0000.
The -0000 section of the activationDateTime key value represents
RFC 822 format. You can specify Z as a shortcut for Greenwich
Mean Time (GMT), such as 2006-05-03T10:30:45Z. If you do
not specify the time zone, the system uses the time zone of the server.
- state
- Specifies the state of the job. Valid values include ASYNC_IN_PROGRESS, SUCCEEDED, PARTIALLY_SUCCEEDED, FAILED, DELAYED, REJECTED,
and NOT_ATTEMPTED.
- target
- Specifies the target node for a job. Use this key to return the
jobs for a specific node. The command returns the jobs for the specific
node and node groups that the node belongs to. You can only specify
one targetID per query.
- The following operators are supported:
Table 1. queryJobs
-query operators. Use an operator in a query.Character |
Value |
= |
Equal to. Specify that the value is null by
using = NULL. |
!= |
Not equal to. Specify that the value is not
null by using != NULL |
> |
Greater than |
< |
Less than |
>= |
Greater than or equal to |
<= |
Less than or equal to |
- -maxReturn
- Specifies the maximum number of matches to return. (Integer, required)
Return value
The
command returns a list of attributes, where the first attribute specifies
the number of matches the query produced, and the second attribute
specifies a list of job tokens that match the query, as the following
sample displays:
[ [result [{activationDateTime=2008-03-11T11:56:48-0500,
expirationDateTime=2008-05-10T11:56:48-0500, jobToken=120525460839085191,
description=testSubmitJobToValidBaseTargetList}{activationDateTime=2008-03-11T14:05:33-0500,
expirationDateTime=2008-05-10T14:05:33-0500, jobToken=120526233387582472,
description=testSubmitJobToValidBaseTargetList}]] [size 2] ]
Batch mode example usage
- Using Jython string:
print AdminTask.queryJobs('-query activationDateTime>= "2006-01-01" activationDateTime<=
"2007-01-01" -maxReturn 20')
print AdminTask.queryJobs('[-query "target = node3" -maxReturn 2]')
- Using Jython list:
AdminTask.queryJobs('-query', 'activationDateTime>= "2006-01-01" activationDateTime<=
"2007-01-01"', '-maxReturn', '20')
print AdminTask.queryJobs(['-query', '"target = node3"', '-maxReturn', '2'])
Interactive mode example usage
- Using Jython string:
AdminTask.queryJobs('-interactive')
resumeJob
The
resumeJob command resumes a previously started or suspended job.
Target object
None.
Required parameters
- -jobToken
- Specifies the unique identifier of the job of interest. (String,
required)
Return value
The
command does not return output.
Batch
mode example usage
- Using Jython string:
AdminTask.resumeJob('-jobToken myToken')
- Using Jython list:
AdminTask.resumeJob('-jobToken', 'myToken')
Interactive mode example usage
- Using Jython:
AdminTask.resumeJob('-interactive')
submitJob
The
submitJob command submits a new administrative job to the job manager.
Target object
None.
Required parameters
- -jobType
- Specifies the type of job to submit. (String, required)
Optional parameters
- -group
- Specifies the name of the group for the target. (String, optional)
- -targetList
- Specifies a list of nodes to target. (String [ ], optional)
- -jobParams
- Specifies the necessary parameters for the job to submit. (Properties,
optional)
- -username
- Specifies the username to use to submit the job when security
is enabled. (String, optional)
- -password
- Specifies the password for the username to use to submit the job
when security is enabled. (String, optional)
- -description
- Specifies a description for the job. (String, optional)
- -activationDateTime
- Specifies the date and time to activate the job in the format
"2006-05-03T10:30:45-0000". The "-0000" section of the activationDateTime
parameter value represents RFC 822 format. You can specify "Z" as
a shortcut for Greenwich Mean Time (GMT), such as "2006-05-03T10:30:45Z".
If you do not specify the time zone, the system uses the time zone
of the server. (String, optional)
- -expirationDateTime
- Specifies the expiration date for the job. (String, optional)
- -executionWindow
- Specifies the recurring interval for the job. (String, optional)
- -executionWindowUnit
- Specifies the recurring interval unit of measure for the value
set by the executionWindow parameter. Specify DAILY to run
the job daily, WEEKLY to run the job weekly, MONTHLY to
run the job monthly, or YEARLY to run the job annually.
Additionally, you can specify CONNECTION to run the job
each time the node connects to the job manager to poll for jobs.
When you specify CONNECTION, do not set the executionWindow
parameter. (String, optional)
- -email
- Specifies the email address that the system sends job notifications
to. (String, optional)
Return value
The
command returns a job token for the newly submitted job.
Batch mode example usage
- Using Jython string:
AdminTask.submitJob('[-jobType createApplicationServer -target profileKey -jobParams
"[serverName myServer]" ]')
- Using Jython list:
AdminTask.submitJob(['-jobType', 'createApplicationServer', '-target', 'profileKey',
'-jobParams', '"[serverName myServer]"'])
Interactive mode example usage
- Using Jython:
AdminTask.submitJob('-interactive')
suspendJob
The
suspendJob command suspends a job that was previously submitted.
Target object
None.
Required parameters
- -jobToken
- Specifies the unique identifier of the job to suspend. (String,
required)
Return value
The
command does not return output.
Batch
mode example usage
- Using Jython string:
AdminTask.suspendJob('-jobToken myToken')
- Using Jython list:
AdminTask.suspendJob('-jobToken', 'myToken')
Interactive mode example usage
- Using Jython:
AdminTask.suspendJob('-interactive')