Question: I am stuck starting with number 4, run your program from cloud shell On the page Methods: instances.stop (Links to an external site.), use the

I am stuck starting with number 4, run your program from cloud shell

  1. On the page Methods: instances.stop (Links to an external site.), use the API Explorer in section Try this API to test stopping your instance using an API. The three fields you need to set are project (id not name), zone, and instance name. Run this tool until you get the parameters correct, then take a screenshot.
  1. Copy the python code from the section Examples and put it in a file on the Cloud Shell. You can either save the file on your local computer and upload the file, or you can open the Cloud Shell code editor.
  1. Edit your python program to change the sections marked TODO, to use the parameters you found in step 1.
  2. Run your program from the Cloud Shell command line using python3 filename.py Make sure your program stops a running instance. You can check this by looking at the Cloud Console.
  3. Modify your program so that instead of printing the entire dictionary, response, it only prints the following, each on a separate line: user, operation type, start date, start time
User name: Operation: stop Starting date: 2019-05-26 Starting time: 13:12:36.826-07:00

Since response is a dictionary, you access the elements like response['user']. Take a screenshot of the output of your program.

  1. In addition to stopping your instance, you should now be able to write a python program to start your instance. See the page Method: instances.start (Links to an external site.)for all the details, though you should find things are very similar to what you have just done. This program should print the same type of information as in step 5 of this assignment. Take a screenshot of its output.
  2. In your Word document, write a paragraph about what you did to write the program in step 6. Include any Linux commands you used.
  3. See the page Method: instances.list (Links to an external site.), for generating a list of your instances. Copy the python program and upload it to your Cloud Shell. Edit the program to specify your project and zone, then replace the print statement with

print(instance['name'], 'is', instance['status'])

Run your program to get a list of your instances and their current status.

  1. Stop your instance, any way that you like. Then run your programs in this order

list, start (wait for it to finish), list, stop, list

Take a screenshot of the output, including the command prompt, so that it shows the following information. Be sure it is a screenshot image.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!