0
0

More than 3 years have passed since last update.

pythonからgoogle cloud platformのinstanceを動かすまで

Posted at

最初に認証キー作ってからでないとだめ
サービス アカウントとして認証する  |  Google Cloud

Python 用の Cloud クライアント ライブラリの使用  |  Compute Engine ドキュメント  |  Google Cloud

python3 -m pip install --upgrade google-api-python-client

python-docs-samples/create_instance.py at master · GoogleCloudPlatform/python-docs-samples

動作テストにこのgithubのコード使った
※そのまま動かすとインスタンスの料金かかるのでそこはコメントアウト推奨。

備考

  • JSON形式のキーの生成はブラウザが楽、SSHクライアントでファイル移せば良いから(筆者はRLoginで移した
  • 権限関係の問題と、プロジェクト名でコマンド打ってたからずっと認識されなかった。そりゃそうだ。

これで
自宅のRaspberryPiからGCPのインスタンスの起動が出来るぞ!!!
やったー

0
0
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
0
0