I have done some work with the Google Cloud Platform or GCP. However in some ways my use currently is quite basic. In short I needed to SSH onto some virtual machines and also copy files.
To do this I first installed the Cloud SDK | Google Cloud Platform. Note that it relies on Python 2.7. With a Mac then I would suggest installing with brew cask install google-cloud-sdk
, although you will still need to modify your ".bash_profile" file. I found when doing this I needed to add the execute permission and also make sure the changes to my profile were prefixed with ". " to get the changes to persist.
There are also instructions at Uninstalling Google Cloud SDK | Cloud SDK Documentation for removing the SDK.
gcloud init
- this is part of the install process but it does allow a new configuration to be setupgcloud info
- display useful information on your installationgcloud auth list
- list known account credentialsgcloud config list
- list local configurationgcloud components update
- update any installed GCloud componentsgcloud compute ssh hostname --project projectname
gcloud compute ssh hostname
- make an SSH connection to hostname in default projectgcloud compute scp /path/localfile.txt hostname:~/.
- copy /path/localfile.txt to my home directory on hostnamegcloud compute scp hostname:~/remotefile.txt .
- copy remotefile.txt from my home directory on hostname to my current directorygcloud compute instances list --filter="labels:dev"
- list instance details where the label matches, however the : is changing to = but they give different result at the moment. "--sort-by status" can be handy
It is important to pick the right data centre for your GCP work, so have a look at GCP ping and the command line version which is available from GoogleCloudPlatform/gcping: Like gcping.com but a command line tool.