Google Command Cheatsheet | CPO200

1. Type the Cloud SDK command to list the available Compute Engine zones and make a note of possible alternatives to your default zone.
gcloud compute zones list 
2. Type the Cloud SDK command to create a bucket, this time using the class Durable Reduced Availability.
gsutil mb -c DRA -l $BUCKET_LOC gs://<dratestbucket>
3. Why is the -m option useful in this gsutil context?

The -m option enables the parallel transfer of files to and from Google Cloud Storage. In this case, the bandwidth is high between Compute Engine and Cloud Storage so it’s advantageous to enable parallel operations which require a fast network connection.

4. How can you read the contents of one of the newly uploaded objects directly from Cloud Storage. What is the command you would type?
gsutil cat gs://<dratestbucket>/<objectname.extension>
5. Type the Cloud SDK command to add a firewall-rule to the default network in the Guestbook project to allow HTTP connections on port 80 from anywhere to instances tagged ‘http’.
gcloud compute firewall-rules create default-allowhttp --allow tcp:80 --target-tags http
6. Type the Cloud SDK command to create a Compute Engine instance based on the guestbook-1 image, tagged with ‘http’ and assign it the < externalipaddress > address.
gcloud compute instances create guestbook --image guestbook-1 --tags http --zone $ZONE --address <externalipaddress>
7. How can you give a snapshot name to your snapshot ?
gcloud compute disks snapshot <diskname> --snapshotname <snapshotname> \
--zone $ZONE
8. How can you authorize and IP address to access the sql instance ?
gcloud sql instances patch mysqlinstancename --authorizednetworks $IP
9. What is the command to describe the project-wide configuration data including metadata ?
gcloud compute projectinfo describe

Published: November 23 2016

  • Category :