cloud hidden whereabouts unknown ….

Monthly Archives: March 2014

Ingredients

Directions

In a large pan bring 2 or 3 inches of water to a slow simmer over medium heat.

In a metal bowl combine egg yolks, sugar, Marsala and salt.

Put the bowl on the simmering water.

Whisk vigorously, avoiding that the eggs scramble, until the mixture is thick and foamy. This may take about 8 minutes or so.

Remove the bowl from the heat and whisk for 30 more seconds.

Serve the Zabaglione warm or chilled.

Enjoy!!

Notes

The way the Italian say it: Zabaglione. The legend says that Captain Giovanni Baglioni who in the 16th Century, while camping in Reggio Emilia, sent his soldiers to seek food. They came back with what they found in the nearby area: eggs, sugar and wine. They mixed everything and found the result delicious so the cream was named after the Captain. Some instead want the cream to be from Venice, where in the 17th century it was common to drink “zabaja”, from Illira (Dalmatia), a drink aromatized with sweet wine from Cyprus.

Marsala is a liquor kind of wine with a Controlled Name of Origin (DOC) produced in Sicily in the Trapani province.

This post demonstrates how to build a Google Cloud Storage XML API Python application. The application interacts with the storage service via the XML API (and the httplib2 library). It uses a simple interface which allows you to perform tasks such as: list the buckets in a project, list objects in a bucket, create a bucket, create an object and so on. The intent of the application is educational. It should help you to understand the API syntax (and semantics) when interacting with Google Cloud Storage.

Update the information contained in the client_secrets.json file. Use your client id and secret available in the Google API Console.

Create the Application Project

Activate Eclipse.

From the File menu, select New->PyDevProject. The PyDev Project window is displayed.

In the Project name: enter PythonXmlApi.

Accept the user default workspace; for example: /Users/[your username]/[your work directory]/PythonXmlApi. This is the directory where the program will be stored.

If you have more than one Python version installed perform the following steps:

In the Grammar Version selection list select 2.7.

In the Interpreter selection list select the desired Python interpreter. For more information, see Configure PyDev.

Click Finish. The PythonXmlApi project is created and displayed in the Package Explorer.

If the PyDev perspective is not selected yet, click on the Open Perspective icon in the upper right corner of Eclipse. From the pop-up menu select PyDev and click OK.

In the Package Explorer, expand the PythonXmlApi project node.

Right-click the src folder.

Select New->PyDev Module.

In the pop-up dialog window enter the following information:

In the Package box enter gcs_examples.

In the Name box enter main.

Click Finish.

Select Module Main and click OK.
An empty main.py is created. Actually the module contains the standard Python check for main because the template chosen. You’ll enter the code needed to interact with Google Cloud Storage in the next section.

Download the Application Code

You can download the archived project from this location: storage-xmlapi-python-client. Then import it into Eclipse. The project contains the following modules:

main.py. This is the main entry point of the application which allows you to

interact with Google Cloud Storage (GCS) using XML API. It contains the main function which is called when the application is executed.

simple_ui.py. Contains the GCS_SimpleUI class which provides a simple UI to interact with Google Cloud Storage.

commands.py. Contains the GCS_Command class which provides the entry point for

processing user’s selection. Based on the user’s selection, the related Google Cloud Storage

operation is executed.

authentication.py. It contains the class that generates an authenticated HTTP client object.

PythonXmlApi Implementation

The PythonXmlApi main function performs the preliminary initialization and starts the application. A set of classes then perform the actual tasks such as: creating a simple UI, processing user’s input, interacting with the storage service and so on. The following picture shows the classes and their hierarchy.

PythonXmlApi Class Hierarchy

PythonXmlApi Workflow

The first time you start the application, the main function instantiates GCS_SimpleUI and GCS_Command classes then initializes a simple user interface which accepts the user’s input. You will be asked to authenticate the application which uses OAuth2.0 and stores the credentials in a local file called stored_credentials.json. Also, you will be asked to enter the project ID which will be stored in a local file called project.dat.

Every time you make a selection a command call is issued which in turn calls a GCS_Bucket or GCS_Object method. This method executes the actual Google Cloud Storage bucket or object request. The storage service’s response is then displayed for your information. If the request fails, an error is displayed. Finally, depending on the debugging level, the application displays what goes on the “wire”. This is to help you understand the actual HTTP request and response content as explained by the Google Cloud Storage documentation Reference Methods. The following picture depicts the workflow just described.