DigitaloceanのCLIツール tugboat
3012 ワード
概要
digitaloceanでのサーバを立ち上げるのに、webサイトを開くのが面倒なんでCLIで操作をできるツールが欲しかった。
vagrant-digitaloceanを使用していたのですが、Linuxディストリビューションを切り替えたいときなどの際に、サイトをみて確認する必要ありが面倒だった。
CLIツール tugboat
インストール
gem install tugboat
rubyは1.9以上
digitaloceanのAPIキー
gem install tugboat
rubyは1.9以上
ここで確認できます。
api_access
環境構築
$ tugboat authorize
Note: You can get this information from digitalocean.com/api_access
Enter your client key: https://cloud.digitalocean.com/api_accessの取得できるclient ID
Enter your API key: https://cloud.digitalocean.com/api_accessで取得できるAPI Key
Enter your SSH key path (optional, defaults to ~/.ssh/id_rsa):
Enter your SSH user (optional, defaults to ログインユーザ名):
Enter your SSH port number (optional, defaults to 22):
To retrieve region, image, size and key ID's, you can use the corresponding tugboat command, such as `tugboat images`.
Defaults can be changed at any time in your ~/.tugboat configuration file.
Enter your default region ID (optional, defaults to 1 (New York)):
Enter your default image ID (optional, defaults to 350076 (Ubuntu 13.04 x64)):
Enter your default size ID (optional, defaults to 66 (512MB)):
Enter your default ssh key ID (optional, defaults to none):
Enter your default for private networking (optional, defaults to false):
Enter your default for enabling backups (optional, defaults to false):
$ tugboat authorize
Note: You can get this information from digitalocean.com/api_access
Enter your client key: https://cloud.digitalocean.com/api_accessの取得できるclient ID
Enter your API key: https://cloud.digitalocean.com/api_accessで取得できるAPI Key
Enter your SSH key path (optional, defaults to ~/.ssh/id_rsa):
Enter your SSH user (optional, defaults to ログインユーザ名):
Enter your SSH port number (optional, defaults to 22):
To retrieve region, image, size and key ID's, you can use the corresponding tugboat command, such as `tugboat images`.
Defaults can be changed at any time in your ~/.tugboat configuration file.
Enter your default region ID (optional, defaults to 1 (New York)):
Enter your default image ID (optional, defaults to 350076 (Ubuntu 13.04 x64)):
Enter your default size ID (optional, defaults to 66 (512MB)):
Enter your default ssh key ID (optional, defaults to none):
Enter your default for private networking (optional, defaults to false):
Enter your default for enabling backups (optional, defaults to false):
とりあえずClient IDとAPI Keyを入力する
設定ファイル
$ cat ~/.tugboat
authentication:
client_key: Client ID
api_key: API Key
ssh:
ssh_user: 作成するサーバにログインするためのユーザ名
ssh_key_path: sshキーのパス
ssh_port: '22'
defaults:
region: '1' # tugboat regions 表示されたidを書く
image: '350076' # tugboat images --global 表示されたidを書く
size: '66' # tugboat sizeで表示されたidを書く
ssh_key: ''xxxxx' #tugboat keysで表示されたidを書く
private_networking: 'false'
backups_enabled: 'false'
$ cat ~/.tugboat
authentication:
client_key: Client ID
api_key: API Key
ssh:
ssh_user: 作成するサーバにログインするためのユーザ名
ssh_key_path: sshキーのパス
ssh_port: '22'
defaults:
region: '1' # tugboat regions 表示されたidを書く
image: '350076' # tugboat images --global 表示されたidを書く
size: '66' # tugboat sizeで表示されたidを書く
ssh_key: ''xxxxx' #tugboat keysで表示されたidを書く
private_networking: 'false'
backups_enabled: 'false'
各種コマンドについては
tugboat --helpやtugboat --help コマンド名で確認できます。
またはtugboatで確認できます。
感想
便利
Author And Source
この問題について(DigitaloceanのCLIツール tugboat), 我々は、より多くの情報をここで見つけました https://qiita.com/masayuki_oguni/items/b2c4078019c941091176著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .