Edited at

rescaleapi-wrapper

More than 1 year has passed since last update.

Rescale API を簡単に使う方法

https://github.com/daikumatan/rescaleapi-wrapper

ファイルアップロードとダウンロードは Rescale CLI をつかったほうが良いので、まだ実装していません。


pre-condition


Creating RescaleAPI


  • Rescaleにサインナップしてください

  • ログインしてください

  • API Keyを作成してください

  • APIをコピーしてください

日本の場合 API Key をすぐに作れないケースが多いですので、その場合は、中の人に連絡したほうがベター


Edit your ~/.bashrc

set the API Key and Platform-URL

if JP,


.bashrc

echo 'export RESCALE_API_KEY=<API KEY>' >> ~/.bashrc

echo 'https://platform.rescale.jp/ >> ~/.bashrc'

if US,


.bashrc

echo 'export RESCALE_API_KEY=<API KEY>' >> ~/.bashrc

echo 'https://platform.rescale.com/ >> ~/.bashrc'


How to use rescaleapi command


Job list

If you want to display the job list including Job-IDs, Please execute the following command.


command

rescaleapi.py job ls


you can indicate the number of jobs with --max=<int>. is positive integer.


command

NUMBER_OF_JOBS=256

rescaleapi.py job ls --max=${NUMBER_OF_JOBS}


Job information

If you want to display the job-information, Please execute the following command. response is json-data.


command

JOBID='<Job-ID obtained when you create the job>'

rescaleapi.py job info ${JOBID}


Create Job (Job Difinition)

you can create the job by using the following command.

(this command doesn't execute the job. Job-difinition is saved in Rescale.)

if you indicate JSON-data directly:


command

JSON='<JSON-DATA to create rescale-job>'

rescaleapi.py job create ${JSON}

else if you indicate JSON-FILE:


command

JSONFILE=<'JSONFILE job'>

rescaleapi.py job create --file ${JSONFILE}


Job submittion (Run)

you can submit the job you created with this command.


command

JOBID='<Job-ID obtained when you create the job>'

rescaleapi.py job submit ${JOBID}


Job Monitor

You can use this command to check the job-status or the end of the job.


command

JOBID='<Job-ID obtained when you create the job>'

rescaleapi.py job monitor ${JOBID}


Job Deletion

You can delete the job with the following command.


command

JOBID='<Job-ID obtained when you create the job>'

rescaleapi.py job delete ${JOBID}


Job Stop

You can stop the running job with the following command.


command

JOBID='<Job-ID obtained when you create the job>'

rescaleapi.py job stop ${JOBID}


Job Sharing

You can share the job to a user account belongint same company account.


basic

JOBID='<Job-ID obtained when you create the job>'

ADDRESS='<e-mail address>'
rescaleapi.py job share ${JOBID} --email=${ADDRESS}


option

JOBID='<Job-ID obtained when you create the job>'

ADDRESS='<e-mail address>'
MESSAGE='<this is my test job>'
rescaleapi.py job share ${JOBID} --email=${ADDRESS} --message=${MESSAGE}


File list

You can take the file list for the Job-ID you indicate.


basic

JOBID='<Job-ID obtained when you create the job>'

rescaleapi.py file ls ${JOBID}


option

JOBID='<Job-ID obtained when you create the job>'

DOE_RUN_NUMBERS="1,4,10,25"
rescaleapi.py file ls ${JOBID} --run=${DOE_RUN_NUMBERS}


File Information

You can take the file-information for the file-ID you indicate.


command

FILEID='<File-ID obtained when you execute "rescaleapi.py file ls" command>'

rescaleapi.py file info ${FILEID}


Help


basic

rescaleapi.py -h


or


basic

rescaleapi.py --help