6. fugaku package

A simple python library to interact with Fugaku WebAPI.

6.1. Submodules

6.1.1. fugaku.client module

fugaku.client

This module provides a client to access Fugaku WebAPI.

class fugaku.client.Client(auth_code, client_config=None, provider_metadata_url=None, authorization_endpoint=None, token_endpoint=None, request_config=None)

ベースクラス: object

cancel_job(machine, jobid)

Cancel a job.

パラメータ:
  • machine (str) -- the specific machine.

  • jobid (str) -- the jobid to cancel.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#delete--queue-machine-jobid)

戻り値の型:

requests.Response

download_fileList(machine, file_path)

Download file list.

パラメータ:
  • machine (str) -- the specific machine.

  • file_path (str) -- the file_path to get the file list.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get--file-machine-file_path)

戻り値の型:

requests.Response

download_filedata(machine, file_path)

Download files.

パラメータ:
  • machine (str) -- the specific machine.

  • file_path (str) -- the download file.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get--file-machine-file_path)

戻り値の型:

requests.Response

exec_command(machine, command)

Execute a command.

パラメータ:
  • machine (str) -- the specific machine.

  • command (str) -- the command to exec.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#post--command-machine)

戻り値の型:

requests.Response

get_authentication_url(redirect_url)

Get URL for user authentication.

If neither authorization_endpoint nor provider_metadata_url is set, only queries can be fetched.

パラメータ:

redirect_url (str) -- the redirect URL to receive authorization code.

戻り値:

return the authentication url.

戻り値の型:

str

get_disk_usage(machine)

Get disk usage.

パラメータ:

machine (str) -- the specific machine.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

戻り値の型:

requests.Response

get_job_detail(machine, jobid)

Get detailed job information.

パラメータ:
  • machine (str) -- the specific machine.

  • jobid (str) -- the jobid is used to get a list of sub-jobs.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get--queue-machine-jobid)

戻り値の型:

requests.Response

get_job_status(machine, index=None, limit=None, status=None, jobid=None)

Get list of running jobs.

パラメータ:
  • machine (str) -- the specific machine.

  • index (int) -- the index for first record.

  • limit (int) -- the limit for number of records.

  • status (str) -- the status is userd filter jobs.

  • jobid (str) -- the jobid is used to get a list of sub-jobs.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get--queue-machine)

戻り値の型:

requests.Response

get_job_status_sacct(machine, index=None, limit=None, status=None, jobid=None)

Get list of completed jobs.

Obtain a list of jobs completed within 24 hours from the job scheduler on the target machine.

パラメータ:
  • machine (str) -- the specific machine.

  • index (int) -- the index for first record.

  • limit (int) -- the limit for number of records.

  • status (str) -- the status is userd filter jobs.

  • jobid (str) -- the jobid is used to get a list of sub-jobs.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get--queue-machine-sacct)

戻り値の型:

requests.Response

get_machine_status()

Get status of all machines. Outputs the status of all machines managed by the server.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get--status-)

戻り値の型:

requests.Response

get_specific_machine_status(machine)

Get specified machine status. Output the status of the specified machine.

パラメータ:

machine (str) -- the specific machine. specify the machine name obtained by getting the status of all machines (get_machine_status). Normally, specify "computer".

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#get--status-machine)

戻り値の型:

requests.Response

make_Jobscript(machine, filename, script)

Generate job execution script.

パラメータ:
  • machine (str) -- the specific machine.

  • filename (str) -- the filename is file path of the script file on the target machine.

  • script (str) -- the script is used to create job exection script.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#put--queue-machine-jobscript)

戻り値の型:

requests.Response

modify_file(machine, file_path, file)

Modify file.

パラメータ:
  • machine (str) -- the specific machine.

  • file_path (str) -- the file_path specifies the upload destination.

  • file (str) -- the upload file.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#put--file-machine-file_path)

戻り値の型:

requests.Response

submit_job(machine, jobfile=None, jobscript=None, qopt=None)

Submit a job.

パラメータ:
  • machine (str) -- the specific machine.

  • jobfile (str) -- the jobfile to submit.

  • jobscript (str) -- the jobscript to submit.

  • qopt (str) -- the qopt to be passed to the Job Scheduler.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#post--queue-machine)

戻り値の型:

requests.Response

upload_file(machine, file_path, file)

Upload file.

パラメータ:
  • machine (str) -- the specific machine.

  • file_path (str) -- the file_path specifies the upload destination.

  • file (str) -- the upload file.

例外:

NoAccessCode -- when there is no access_token.

戻り値:

return the request.

(see. https://www.fugaku.r-ccs.riken.jp/doc_root/en/user_guides/webapi_experimental/webapi/api-reference.html#post--file-machine-file_path)

戻り値の型:

requests.Response

6.1.2. fugaku.error module

fugaku.error

This module contains the set of fugaku' exceptions.

exception fugaku.error.FugakuClientError

ベースクラス: Exception

An ambiguous exception occurred during processing of the fugaku client.

exception fugaku.error.NoAccessCode

ベースクラス: FugakuClientError

if access_code is not set

exception fugaku.error.NoTokenEndpoint

ベースクラス: FugakuClientError

if token_endpoint is not set