Manage jobs with CLI
You can administer jobs in a project by using CLI commands.
Use the following CLI commands to administer jobs:
wscli edit worker [options]
wscli add projectjob [options]
wscli list projectjobs [options]
wscli delete projectjob [options]
wscli add projectjobrun [options]
wscli list projectjobruns [options]
wscli get projectjobrun [options] --show-status
wscli get projectjobrun [options] --show-logs
Add jobs
wscli add projectjob command currently supports running a script or
notebook. Use the following mandatory
options: -pn --project-name <projectName>
The project in Watson Studio
-pjn --projectjob-name <projectjobName>
The name of the job in a project
-afp --asset-file-path <assetFilePath>
The asset file path relevant to the project root folder, e.g.: "/scripts/Testscript.py"
-re --runtime-environment <runtimeEnvironment>
The runtime environment is specified by the name of the the image being used. This may be
the name of a custom image or "dsx-scripted-ml-python2" for the included environment
"Jupyter with Python 2.7, Scala 2.11,R 3.4.3", and "dsx-scripted-ml-python3" for the
included environment "Jupyter with Python 3.5, Scala 2.11,R 3.4.3"
To find the value of the --asset-file-path option, run the following
command:
wscli list assets -pn project-name
The asset file path is displayed in the Path column. The Watson Studio Local CLI currently supports creating jobs by using script and Jupyter types.

To find the value of --runtime-environment option for the job, run the following
command:
wscli list workers
The name of the worker to be used for --runtime-environment is displayed in the
Component line.

This value changes depending on whether a worker is configured to use a custom image. If you change the image that is associated with a worker, you will want to view this list again to see the new value for Component.
For example:
wscli add projectjob -pn test -pjn job1 -afp "/jupyter/nb1.jupyter.ipynb" -re cust-py35-v1-dsx-scripted-ml-python3 -ast notebook-run
Job workers
The running environment of a job is called a "worker", which specifies the image being used and resource reservations. Watson Studio Local CLI currently supports modifying the image, CPU, and memory reservations.
For custom images, the name in the list can be used as the value for the runtime environment. For the IBM-provided images, you need to specify the internal name for that image instead of the display name. The following table maps the display name to the internal name:
| IBM-provided image name | Internal name |
|---|---|
| Jupyter with Python 2.7, Scala 2.11, R 3.4.3 | dsx-scripted-ml-python2 |
| Jupyter with Python 3.5, Scala 2.11, R 3.4.3 | dsx-scripted-ml-python3 |
| Jupyter 4.4 and Python 3.5 for GPU | dsx-scripted-ml-gpu-python3 |
| RStudio with R 3.4.3 | rstudio-worker |
| SPSS Modeler | spss-worker |
To find a valid image name that can be used for the job worker, check the Watson Studio Job Workers page, such as in the following example:

wscli edit worker -pn test -re cust-py35-v1-dsx-scripted-ml-python3wscli edit worker -pn test -re dsx-scripted-ml-python3wscli edit worker -pn test -re dsx-scripted-ml-python3 -cr 1000 -mr 1000Job runs
To create a Watson Studio Local job that is run by using CLI, run the following command:
wscli add projectjobrun -pn project-name -pjn job-name -jrn run-name
This command returns a job run ID that can be used to retrieve details of the job run.
To display all job runs for a project job, run the following command:
wscli list projectjobruns -pn project-name -pjn job-name
To display the details of a specific job run, run the following command:
wscli get projectjobrun -pn project-name -pji job-id --display-logs
wscli get projectjobrun -pn project-name -pji job-id --display-status