LoginSignup

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 5 years have passed since last update.

RescaleAPI Hands-on 事前準備編

Last updated at Posted at 2017-02-13

1. API Token (APIキー)の作成と設定

1.1 API Token (APIキー) の発行

API Token (APIキー) を以下かから作成します。
http://qiita.com/daikumatan/private/5d33f0a9c0030bfd7743

1.2 API Token (APIキー)環境変数に設定する

画面に表示されたAPIキーをコピーして、お手持ちのUnix系ターミナルに下記環境変数を設定してください。

環境変数の設定
export RESCALE_API_TOKEN="XXXXXXXXXXXXXXXXXXXXXXXX"

2. その他事前準備

2.1 RescaleAPIを使用したスクリプトの保存先設定

スクリプト保存場所の設定
workdir=$(pwd)
script=${workdir}/api
mkdir ${script}
export PATH=${script}:${PATH}

2.2 jqのインストール

jqのインストール
wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
chmod +x jq-linux64
mv jq-linux64 ${script}/jq

2.3 Sample Run Script の生成

以下のコマンドを実行し、サンプルのランスクリプトを生成してください。

uploadFile
uploadFile='sample.sh'
ランスクリプト
cat << EOF > ${workdir}/${uploadFile}
#!/bin/sh
date
pwd
ls -l
echo "Hello World"
sleep 300
EOF
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up