pacclient.py

pacclient.py is a sample web service for accessing IBM Spectrum LSF Application Center.

Note: The IBM Spectrum LSF Application Center package does not include pacclient.py. To download the latest version of pacclient.py, which supports python3, refer to https://github.com/IBMSpectrumComputing/lsf-integrations/tree/master/Spectrum%20LSF%20Application%20Center/pacclient.

Synopsis

pacclient.py subcommand [options]
pacclient.py [subcommand] -h

Description

Use pacclient.py to submit commands to IBM Spectrum LSF Application Center through the web service.

-h

Prints command or subcommand usage to stdout and exits.

pacclient.py ping

Synopsis

pacclient.py ping -l URL

Description

Detects whether or not the web service is running at the specified URL. If no parameters are specified, prompts for the URL interactively.

Options

-l URL

Specify the URL of the IBM Spectrum LSF Application Center web service in the format:

http://host_name:port_number/

Examples

pacclient.py ping -l http://pac_host:8080/

pacclient.py logon

Synopsis

pacclient.py logon -l URL -u user_name -p password

Description

Logs you in to IBM Spectrum LSF Application Center.

Use double quotes around any value that contains spaces.

If any parameter is omitted, you will be prompted interactively.

Once you are logged in, you may run other pacclient.py commands, until you log out. You will be logged out automatically if you do not run any pacclient.py commands for 60 minutes consecutively.

Options

-l URL

Specify the URL of the IBM Spectrum LSF Application Center web service in the format:

http://pac_host:port_number/

-u user_name

Specify your user name.

-p password

Specify your password.

Examples

pacclient.py logon -l http://pac_host:8080/ -u user2 -p mypassword

pacclient.py logout

Synopsis

pacclient.py logout

Description

Logs you out.

Once you are logged out, you must log in to run more pacclient.py commands.

You will be logged out automatically if you do not run any pacclient.py commands for 60 minutes consecutively.

Examples

pacclient.py logout

pacclient.py app

Synopsis

pacclient.py app -l | -p app_name[:template_name]

Description

List applications or parameters of an application.

Options

-l

List all applications and application status.

-p app_name[:template_name]

List all parameters and default values for the specified application. To see parameter values saved in your application, specify both the published form name and the submission template name.

Examples

pacclient.py app -p FLUENT

pacclient.py submit

Synopsis

pacclient.py submit -a app_name[:template_name] [-c file_path] [-p field_ID=value;[field_ID=value;]]

Description

Submits a job.

Use double quotes around any value that contains spaces.

Parameters defined in the command line (-p) override all others; parameters defined in a file (-c) override parameters defined in an application form (-a).

Options

-a "app_name[:template_name]"

Required. Specify the published application form to use for default job submission parameters.

Specify the application name and optionally the name of your submission template.

[-c file_path ]

Set job submission parameters from a file.

Specify the path to a file on the local host that defines job parameters and input files. The file format is a list of field ID and value pairs:

  • field_ID

    Specify the field ID from the application form template.

    You must be an administrator in Platform Application Center to access editing mode and view the field IDs.

  • value

    Specify the value for the field input.

    If the field requires a file for input, you must also choose to upload the file, copy the file to the job directory, or link the file to the job directory.

    Specify the value in the following format. To specify multiple files, separate with a hash (#):

    file_path,upload[#file_path,upload]

    file_path,copy[#file_path,copy]

    file_path,copy[#file_path,copy]

For example:

Submit the job and copy the specified input file to the job directory:

MY_INPUT_FILE=/home/user1/myfile,copy

Submit the job and link the specified files to the job directory:

MY_INPUT_FILE=/home/user1/myfile3,link#/home/user1/myfile4,link

Submit the job and upload one file for FLUENT_JOURNAL and multiple CAS_INPUT files to the job directory:

[Parameter]
JOB_NAME=FF_20100329
VERSION=6.3.26
CONSOLE_SUPPORT=No
[Inputfile]
FLUENT_JOURNAL=C:\demo\fluent\fluent-test.jou,upload
CAS_INPUT_FILE=C:\demo\fluent\fluent-test.cas.gz,upload#C:\demo\fluent\fluent-test.cas2.gz,upload
[-p field_ID=value;[field_ID=value;]...]

Define the job submission parameters on the command line.

Specify field ID and value pairs as described for the -c option.

Examples

Submit the job and link the specified file to the job directory

pacclient.py submit -a "FLUENT" -c "C:\mydir\fluentconf.txt" -p "CONSOLE_SUPPORT=yes;CAS_INPUT_FILE=C:\mydir\fluent\fluent-test.cas.gz,link"

pacclient.py job

Synopsis

pacclient.py job [-l] [-u user_name | -u all ] [-p hours] job_ID | "job_ID[index_list]"
pacclient.py job -s Pending|Running|Done|Exit|Suspended [-l] [-u user_name | -u all ] [-p hours]
pacclient.py job [-l ] job_ID | "job_ID[array_index]"
pacclient.py job -n job_name [-l] [-u user_name | -u all ] [-p hours]
pacclient.py job -g job_group_name [-l] [-u user_name | -u all ] [-p hours]
pacclient.py job -h

Description

Displays information for one or more jobs.

By default, displays information about pending, running, and suspended jobs submitted by the user running this command. By default, also displays information about done and exited jobs submitted by the user running this command that have ended within the past hour.

Output includes the external status for a job in the column BSTATUS. You use bpost -d to provide external status information for a job. You can also view this status in the Jobs page, with the Ext Status column. You will need to select the column for display by clicking the Options button.

Options

-l

Long format. Displays detailed information for each job, job array, or job group in a multiline format.

-u user_name | -u all

Only displays information about jobs that have been submitted by the specified user. The keyword all specifies all users.

-p hours

In addition to pending, running, and suspended jobs, displays information about all done and exited jobs that have ended within the specified number of hours. If the number of hours is not specified, displays information about done and exited jobs submitted by the user running this command that have ended within the past hour.

-s Pending|Running|Done|Exit|Suspended

Displays information only about jobs that have the specified state.

-n job_name

Displays information about jobs or job arrays with the specified job name. The wildcard character (*) can be used within a job name, but cannot appear within array indices. For example job* returns jobA and jobarray[1], *AAA*[1] returns the first element in all job arrays with names containing AAA, however job1[*] will not return anything since the wildcard is within the array index.

p job_ID

Display information for the job with the specified job ID.

-g job_group_name

Display information for jobs in the specified job group.

-h

Display subcommand usage.

Examples

Get information about jobs submitted by the user who is logged on

pacclient.py job

Get information about jobs submitted by user user1

pacclient.py job -u user1

Get detailed information about job 11919

pacclient.py job -l 11919

Get detailed information about jobs with the job name TEST

pacclient.py job -l -n TEST

Get detailed information about jobs with the status Running

pacclient.py job -l -s Running

Get information about the job array element 1 in job array 11921

pacclient.py job "11921[1]"

Get information about jobs in job group /dev

pacclient.py job -g "/dev"

Get information about jobs with the status Exit that have ended within the last 5 hours

pacclient.py job -s Exit -p 5

Get information about jobs submitted by user user2 with the status Done that have ended within the last hour

pacclient.py job -u user2 -s Done -p 1

pacclient.py jobaction

Synopsis

pacclient.py jobaction -a kill|suspend|requeue|resume job_ID

Description

Control a job.

Options

-a kill|suspend|requeue|resume

Specify the job action. You can kill, suspend, requeue, or resume a job.

job_ID

Specify the job ID.

Examples

pacclient.py jobaction -a resume 54321

pacclient.py jobdata

pacclient.py jobdata -l job_ID

Description

List input and output files for a job.

Options

-l job_ID

Specify the ID of the job for which to list files.

Examples

List files for job with ID 1234

pacclient.py jobdata -l 1234

pacclient.py download

Synopsis

pacclient.py download [-d dir_name] [-f file_name [,file_name ...]] [-c compression_command] job_ID

Description

Download job data for a job.

By default, downloads all job data files for the job to the current working directory.

Options

[-d directory]

Copy files to the specified directory.

[-f file_name [,file_name ...]]

Downloads the specified files. When specifying multiple file names, use a comma-separated list. You can also use the following wildcard characters in a file name to indicate multiple files, including the following characters:

  • * - any number of alphanumeric characters
  • ? - a single alphanumeric character
  • [0-9] - a numeric character between 0 and 9.
  • [a-z] - a single lower case letter from a to z.
  • [A-Z] - a single capital letter from A to Z.

If there are white spaces or wildcard characters in the text, you must use double-quotation marks to enclose the text.

[-c compression_command]

Command for the compression program to use to create compressed files to download. Files are compressed, then downloaded to the client. The client must decompress the files after download. The compression program must be installed on the Platform Application Center server and must be in the system path.

job_ID

Specify the job ID.

Examples

For example:

pacclient.py download 54321

pacclient.py download -f "jobfile_*" 54321

pacclient.py download -f "jobfile_1,jobfile_2,jobfile_3" 54321

pacclient.py download -f "jobfile_[0-9]" 54321

pacclient.py download -f "jobfile_*,file 1.txt, file 2.txt" 54321

pacclient.py download -f "jobfile" -c gzip 54321

pacclient.py upload

Synopsis

pacclient.py upload [-d dir_name] -f file_name[,file_name..] job_ID
pacclient.py upload -d host_name:dir_name -f file_name[,file_name..]
pacclient.py upload -h

Description

Uploads data for a job to the job directory on the web server or the remote directory on a specific host.

By default, if a job ID is specified but no directory is specified, files are uploaded to the job directory on the web server.

Options

-d dir_name

Copies files to the specified directory on the web server. The directory can be an absolute path on the web server or a relative path to the job directory on the web server.

-d host_name:dir_name

Uploads files to the specified job directory on the specified host. The directory must be an absolute path to the remote job directory on the host. The host can be any LSF® server host.

-f file_name[,file_name...]

Uploads the specified file. Specify the path. Separate multiple files with a comma. If no path is specified for the file, the job directory on the web server is used as the location of the file.

job_ID

Only used to upload files to the job directory on the web server. The ID of the job for which to upload files. The job must have the state Running. The ID must be a positive integer.

-h

Display subcommand usage.

Examples

Upload files to the job directory on the web server

pacclient.py upload -f /dir1/file1,/dir2/file2 54321

Upload file1 into the result subdirectory under job 101's job directory

pacclient.py upload -d result -f file1 101

Upload file1 into /tmp/result on the web server

pacclient.py upload -d /tmp/result -f file1

Upload file1 into /tmp/result on the remote host host1

pacclient.py upload -d  host1:/tmp/result -f file1

pacclient.py usercmd

Synopsis

pacclient.py usercmd -c user_command

Description

Runs the specified command as the user who is logged on to the web server host.

List commands in the configuration file $GUI_CONFDIR/webservice.usercmd.

By default, the following LSF commands are listed in the file:

  • bbot
  • bchkpnt
  • bkill
  • bpost
  • brequeue
  • brestart
  • bresume
  • brun
  • bstop
  • btop
  • bswitch
  • bmig

You can also add any other commands to the file that you want to run such as for example, ls or hostname.

Options

-c user_command

Specify the executable command with its full path and options. The command must be listed in the configuration file $GUI_CONFDIR/webservice.usercmd.

-h

Display subcommand usage.

Examples

Kill job 101 by sending a SIGTERM signal

pacclient.py usercmd -c bkill -s SIGTERM 101

Force checkpoint of job 201 every 5 minutes

pacclient.py usercmd -c bchkpnt -f -p 5 201

pacclient.py useradd

Synopsis

pacclient.py useradd [--help | -h] --username |-u username [--email |-e email_address] [--role |-r role1,role2,role3...]

Description

Adds a new user to IBM Spectrum LSF Application Center

For example:
pacclient.py useradd -u testUser -e testUser@domain.com -r Role1,Role2,Role3

If -u,-e or -r are omitted, you will be prompted.

Options

--help | -h

Display subcommand usage.

[--username|-u]

Required. The username to add to IBM Spectrum LSF Application Center.

[--email | -e]

Optional. Email address of the user to add.

[--role | -r]

Required. The role names to assign to the user. Multiple role names must be separated by a comma.

pacclient.py userdel

Synopsis

pacclient.py userdel [--help | -h] --username |-u username

Description

Removes a user from IBM Spectrum LSF Application Center

For example:
pacclient.py userdel -u User1

If -u is omitted, you will be prompted.

Options

--help | -h

Display subcommand usage.

[--username|-u]

Required. The username to remove from IBM Spectrum LSF Application Center.

pacclient.py userupd

Synopsis

pacclient.py userupd
pacclient.py userupd --file | -f file_path

Description

Updates user email in CSV format from IBM Spectrum LSF Application Center.

Options

--file | -f file_path
Updates user emails by importing a CSV file with comma-separated user name and user email in fixed columns. For example:
user1,user1@company.com
user2,user2@company.com

Usage example: pacclient.py userupd -f /file/path/emails.csv

pacclient.py pacinfo

Synopsis

pacclient.py pacinfo

Description

Displays IBM Spectrum LSF Application Center version, build number, and build date

Example


pacclient.py pacinfo
IBM Spectrum LSF Application Center Version 10.1.0.7 Build 332182,15 Feb, 2018

pacclient.py notification

Synopsis

pacclient.py notification --register | -r workload_id [--param|-p "name=value[;name=value]"]
pacclient.py notification --settings | -s

Description

Registers notifications for a workload and displays notification settings.

Options

--register | -r workload_id [--param|-p "name=value[;name=value]"]

Registers notifications for a workload. For example, pacclient.py notification -r 128 -p "NOTIFY_EVENTS=START,END;NOTIFY_CHANNELS=EMAIL"

--settings | -s
Displays the notification settings for the current user. For example:
pacclient.py notification -s
Notification settings for the current user user1
Notification parameters:
NOTIFY_ENABLE=Y
NOTIFY_EVENTS=START,END
NOTIFY_CHANNELS=BROWSER
--register | -r workload_id

Specifies the ID of the workload for which to register notifications.

[--param|-p "name=value[;name=value]"]

Specifies notification parameters with name and value pairs delimited by a semicolon:

NOTIFY_EVENTS Specifies the workload state changes that will trigger a notification. Possible values: START, END, SUSPENDED, EXIT delimited by a comma (no white spaces). [optional]

NOTIFY_CHANNELS Specifies the channels for delivery of workload state change notifications. Possible values: BROWSER, DESKTOP, MOBILE, EMAIL delimited by a comma (no white spaces). BROWSER is always enabled by default.

Use double quotes around notification parameters.

If -p is omitted, the notification settings for the current user are applied.

--settings | -s

Displays the notification settings for the current user.

pacclient.py flow

Synopsis

pacclient.py flow
pacclient.py flow [-f flow_name] [-i flow_id] [-u user_name | -u all] [-s Running | Exit | Killed | Done | Suspended]

Description

Displays flow instances. With no options, displays only flow instances submitted by the current user.

Options

-f flow_name

Displays flow instances using the specified flow definition (short flow definition name). For example, pacclient.py flow -f flow1

-i flow_id

Displays flow instance with the specified flow ID. For example, pacclient.py flow -i 40

-u user_name | -u all

Displays flow instances that have been submitted by the specified user. The keyword "all" shows flow details for all users.

-s Running | Exit | Killed | Done | Suspended

Displays flow instances that are currently in the state specified.

pacclient.py flowaction

Synopsis

pacclient.py flowaction --action | -a kill|suspend|resume flow_id
pacclient.py flowaction --action | -a rerun [-v variables] flow_id
pacclient.py flowaction --action | -a setvar -v variables flow_id

Description

Performs an action on a flow instance.

Options

--action | -a kill | suspend | resume flow_id

Specify the "Kill", "Suspend", or "Resume" flow action. For example, pacclient.py flowaction -a kill 40

--action | -a rerun [-v variables] flow_id

Specify the "Rerun" flow action and optionally specify the input variables. For example, pacclient.py flowaction -a rerun -v "a=1;b=2;c=3" 40

--action | -a setvar -v variables flow_id

Specify the set variables flow action and specify the input variables. For example, pacclient.py flowaction -a setvar -v "a=1;b=2;c=3" 40

-v variables

The input variables provided to the flow instance when using "rerun" or "setvar". This option is required for "setvar", and optional for "rerun". The variables are separated by semicolons (;).

flow_id

Specifies the flow instance ID.

pacclient.py flowdef

Synopsis

pacclient.py flowdef
pacclient.py flowdef [-n flow_name] [-u user_name | -u all] [-s onhold | released] [-p]

Description

Displays flow definitions. With no other options, displays only the flow definitions owned by the current user.

Options

-n flow_name

Displays flow definitions containing the specified flow definition name (short flow definition name). For example, pacclient.py flowdef -n flow1

-u user_name | -u all

Displays flow definitions owned by a specific user or use the keyword "all" to list flow definitions for all flow owners.

-s onhold | released

Displays flow definitions with a state of Onhold or Released.

-p

Displays published flow definitions.

pacclient.py flowdefaction

Synopsis

pacclient.py flowdefaction --action | -a submit [-v variables] flow_name
pacclient.py flowdefaction --action | -a publish | unpublish | hold | release flow_name
pacclient.py flowdefaction --action | -a commit [-c comment] [-v version] file_path
pacclient.py flowdefaction --action | -a delete [-f] flow_name

Description

Performs an action on a flow definition.

Options

--action | -a submit [-v variables] flow_name

Submits the flow definition. Optionally specify input variables to provide to the flow definition when it is submitted. The variables are separated by semicolons (;). For example, pacclient.py flowdefaction -a submit -v "a=1;b=2;c=3" "username:flow1"

--action | -a publish | unpublish | hold | release flow_name

Specifies a flow action. You can publish, unpublish, hold, or release a flow definition. For example, pacclient.py flowdefaction -a publish "username:flow1"

--action | -a commit [-c comment] [-v version] file_path

Commits the flow definition. Optionally set a comment and version to the flow definition when it is committed. For example, pacclient.py flowdefaction -a commit -c "A test flow" -v 1.2 "/home/user/flow1.xml"

--action | -a delete [-f] flow_name

Deletes a flow definition. Optionally use -f to request Process Manager to forcefully remove the flow definition even if there are proxy events associated with the flow definition. For example: pacclient.py flowdefaction -a delete -f "username:flow1"