Google Cloud Storage supports a RESTful API, with payload in XML format, to allow programmatic access to the service. Using XML API
This command line application shows how to programmatically interact with Google Cloud Storage through the SummaryXML API. 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.
Before running the application, assure that you satisfy the following prerequisites: Background
- Install the required software as listed next:
- Update the information contained in the client_secrets.json file. Use your client id and secret available in the Google API Console.
The first time you run the application, you will be asked to authenticate it. The application 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.
In a terminal window activate the program as follows: Usage
python main.py --logging_level [DEBUG | INFO | WARNING | ERROR | CRITICAL]
You can find more details on how to build the application and run it in Eclipse (or in a Terminal window) here: Build a Google Cloud Storage XML API Python Application.