Skip to content
This repository was archived by the owner on Jul 14, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc

# Logs and databases #
######################
*.log

# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
60 changes: 30 additions & 30 deletions api/doc/spec.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ UnitHosting API仕様書 ver 1.2

このドキュメントは、株式会社ディノが提供する、*ユニットホスティング*サービスのWebサービスAPI(以下、UHAPIと記述)の実装ガイドです。UHAPIでは以下のAPIサービスを提供します。


### サーバAPIサービス

単一のサーバインスタンスの制御を行います。サーバAPIを利用するためには、サーバのインスタンスIDと有効なAPIキーを入手する必要があります。
Expand Down Expand Up @@ -40,83 +40,83 @@ XML-RPCエンドポイント
現在のサーバのステータスを返します。

#### 引数

* string instance_id : サーバのインスタンスID
* string api_key : サーバのAPIキー

#### 戻り値

* running : 動作中
* halted : 停止中

### vm.start

#### 説明

停止しているサーバを起動します。

#### 引数

* string instance_id : サーバのインスタンスID
* string api_key : サーバのAPIキー

#### 戻り値

* string result : 実行結果(成功なら success)

### vm.shutdown

#### 説明

起動しているサーバをシャットダウン(ソフトシャットダウン)します。

#### 引数

* string instance_id : サーバのインスタンスID
* string api_key : サーバのAPIキー

#### 戻り値

* string result : 実行結果(成功なら success)

### vm.powerOff

#### 説明

起動しているサーバをシャットダウン(ハードシャットダウン)します。vm.powerOff(ハードシャットダウン)はなるべくせずに可能な限りvm.shutdown(ソフトシャットダウン)を利用してください。

#### 引数

* string instance_id : サーバのインスタンスID
* string api_key : サーバのAPIキー

#### 戻り値

* string result : 実行結果(成功なら success)

### vm.reboot

#### 説明

起動しているサーバを再起動します。メモリ・CPUコア・ディスクの変更があれば反映します。

#### 引数

* string instance_id : サーバのインスタンスID
* string api_key : サーバのAPIキー

#### 戻り値

* string result : 実行結果(成功なら success)

### vm.destroy

#### 説明

サーバを削除します。削除は停止(halted)時にしか行えません。

#### 引数

* string instance_id : サーバのインスタンスID
* string api_key : サーバのAPIキー

Expand All @@ -127,21 +127,21 @@ XML-RPCエンドポイント
### vm.renew

#### 引数

* string display_name : 表示名
* string rootpw : rootパスワード
* string ssh_key : sshのキー
* string user_script : ユーザスクリプトURI

以下の引数はオプションです:

* string op_user : user名(ユーザスクリプト内で利用)
* string op_mail : メールアドレス(ユーザスクリプト内で利用)

#### 戻り値

* string result : 実行結果(成功なら success)

#### 説明

サーバの初期化。初期化は停止(halted)時にしか行えません。
Expand All @@ -152,7 +152,7 @@ XML-RPCエンドポイント

* string instance_id : サーバのインスタンスID
* string api_key : サーバのAPIキー

#### 戻り値

* array
Expand All @@ -162,7 +162,7 @@ XML-RPCエンドポイント
#### 説明

サーバに割り当てられているIPドレスについての情報を返します。


### vm.getMemoryUnitSize

Expand All @@ -189,7 +189,7 @@ XML-RPCエンドポイント
* string instance_id : サーバのインスタンスID
* string api_key : サーバのAPIキー
* integer size : セットする追加メモリサイズ

#### 戻り値

* string result : 実行結果(成功なら success)
Expand Down Expand Up @@ -226,7 +226,7 @@ XML-RPCエンドポイント
* string instance_id : サーバのインスタンスID
* string api_key : サーバのAPIキー
* integer num : セットする追加CPUのコア数

#### 戻り値

* string result : 実行結果(成功なら success)
Expand All @@ -245,7 +245,7 @@ XML-RPCエンドポイント
* string instance_id : サーバのインスタンスID
* string api_key : サーバのAPIキー
* string display_name : 表示名

#### 戻り値

* string instance_id : サーバのインスタンスID
Expand All @@ -266,7 +266,7 @@ XML-RPCエンドポイント

* string instance_id : サーバグループのインスタンスID
* string api_key : サーバグループのAPIキー

#### 戻り値

* array
Expand All @@ -283,38 +283,38 @@ XML-RPCエンドポイント

* string instance_id : サーバグループのインスタンスID
* string api_key : サーバグループのAPIキー

* string display_name : 表示名
* string rootpw : rootパスワード
* string ssh_key : sshのキー
* string user_script : ユーザスクリプトURI

以下の引数はオプションです:

* string op_user : user名(ユーザスクリプト内で利用)
* string op_mail : メールアドレス(ユーザスクリプト内で利用)

* string plan_id : プランID

* string instance_id : サーバグループのインスタンスID

#### 戻り値

* string instance_id : サーバのインスタンスID
* string result : 実行結果(成功なら success)

#### 引数

* string instance_id : サーバグループのインスタンスID
* string api_key : サーバグループのAPIキー

#### 戻り値

* integer id : plan_id
* string name : プラン名
* string cycle : 課金サイクル(hourly,monthly)
* float point : 課金ポイント(cycle毎)

#### 説明

現在利用可能なプランの一覧を取得します。
Expand Down Expand Up @@ -344,7 +344,7 @@ Ruby,PHP,Python,Perlの各言語によるスケールアップのサンプルプ

* 1.0 APIマニュアル初版公開
* 1.1 `vm.getIpInfo`の追加




Expand Down
6 changes: 3 additions & 3 deletions scripts/daemontools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ diff -ur daemontools-0.76.old/src/error.h daemontools-0.76/src/error.h
@@ -3,7 +3,7 @@
#ifndef ERROR_H
#define ERROR_H

-extern int errno;
+#include <errno.h>

extern int error_intr;
extern int error_nomem;
EOF
./package/install
./package/install

6 changes: 3 additions & 3 deletions scripts/djbdns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ tar xvzf djbdns-1.05.tar.gz
cd djbdns-1.05

patch <<EOF
diff -ur error.h error.h.orig
diff -ur error.h error.h.orig
--- error.h.orig 2011-01-01 10:54:33.000000000 +0900
+++ error.h 2011-01-01 10:54:12.000000000 +0900
@@ -1,7 +1,7 @@
#ifndef ERROR_H
#define ERROR_H

-extern int errno;
+#include <errno.h>

extern int error_intr;
extern int error_nomem;
EOF
Expand Down
4 changes: 2 additions & 2 deletions scripts/eccube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DirectoryIndex index.html index.php
<Directory "/var/www/sites/eccube-2.4.3/html">
AllowOverride All
Options +FollowSymLinks

AuthUserFile /var/www/etc/htpasswd
AuthGroupFile /dev/null
AuthType Basic
Expand All @@ -33,7 +33,7 @@ EOF

cd /var/www/sites/
wget http://downloads.ec-cube.net/src/eccube-2.4.3.tar.gz
tar xvzf eccube-2.4.3.tar.gz
tar xvzf eccube-2.4.3.tar.gz
chmod 777 eccube-2.4.3/html/install/temp

# global ipの取得
Expand Down
2 changes: 1 addition & 1 deletion scripts/nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ cd nginx-0.9.4
--lock-path=/var/lib/nginx/run \
--with-http_ssl_module
make install

4 changes: 2 additions & 2 deletions scripts/openpne.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cat <<EOF > /etc/httpd/site.d/openpne.conf
<Directory "/var/www/sites/OpenPNE3/web">
AllowOverride All
Options +FollowSymLinks

AuthUserFile /var/www/etc/htpasswd
AuthGroupFile /dev/null
AuthType Basic
Expand Down Expand Up @@ -73,7 +73,7 @@ IE:
http://uhuser@$GLOBAL_IP/
others:
http://uhuser:$password@$GLOBAL_IP/

--------------------

I placed the password at /home/uhuser/openpne-password.txt,too.
Expand Down
4 changes: 2 additions & 2 deletions scripts/passenger-nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gem install passenger
cd /usr/src
wget http://nginx.org/download/nginx-0.9.4.tar.gz
tar xvzf nginx-0.9.4.tar.gz
sudo /usr/sbin/adduser nginx -d /var/lib/nginx -s /sbin/nologin
sudo /usr/sbin/adduser nginx -d /var/lib/nginx -s /sbin/nologin

./configure \
--user=nginx \
Expand Down Expand Up @@ -34,5 +34,5 @@ EOF
chmod +x /var/lib/nginx/run




6 changes: 3 additions & 3 deletions scripts/ucspi-tcp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ tar xvzf ucspi-tcp-0.88.tar.gz
cd ucspi-tcp-0.88

patch <<EOF
diff -ur error.h error.h.orig
diff -ur error.h error.h.orig
--- error.h.orig 2011-01-01 10:54:33.000000000 +0900
+++ error.h 2011-01-01 10:54:12.000000000 +0900
@@ -1,7 +1,7 @@
#ifndef ERROR_H
#define ERROR_H

-extern int errno;
+#include <errno.h>

extern int error_intr;
extern int error_nomem;
EOF
Expand Down