GCP101 Chapter 15 Using Gcloud from the Google Cloud SDK

Previous chapter | TOC | GCP | Next chapter

© Copyright 2018 Nickantony Quach. All rights reserved.

1 About the Google Cloud SDK

Google Cloud SDK is a set of tools that you can use to manage resources and applications hosted on Google Cloud Platform. These include the gcloud, gsutil, and bq command line tools. Tell me more

2 About the tool Gcloud

The gcloud tool allows you to interact with your cloud resources. Do the following to experience its use.

  1. Sign in with GCP.
  2. Use the GCP Shortcuts at Ri4C to access the Google Cloud Shell Editor. You should see the white shell editor and the black shell console.
  3. In the black shell console, if not already done, run the command, gcloud init, to initialize the tool.
  4. Run the shell command, gcloud config list, to access gcloud config info.
  5. Under the section, [core], the variable project should be set to your current project name.
  6. If not, run the shell command, gcloud config set project tb4gcp18a, where tb4gcp18a is the name of your current project.
  7. Run the shell command, gcloud config list, again to verify that its project value has been set correctly.
  8. Run the shell command as specified in the next line.
  9. gcloud beta functions call datastore_setvalue –data ‘{“kind”:”mytable1″, “key”:”myrow2″, “value”:{“mycolumn3″:”mydata67”} }’
  10. If the result is, “error: Endpoint read failed”, do it again and run the same shell command as specified in the previous line.
  11. The resulting output should be: “Entity mytable1/myrow2 saved.”
  12. Go to the Google Cloud Datastore.
  13. Search for mytable1. Myrow2 under mycolumn3 should now be: mydata67

*** End of Chapter ***

Next chapter


© Copyright 2018 Nickantony Quach. All rights reserved. | Other books | Edit

Advertisements