Hello All, Let me start by introducing myself. I am Samridh, a student developer part of Google Summer of Code (GSoC). I have been contributing to the Aeolus project for the better part of the summer, adding API support for hardware profiles to the Conductor API. My mentor is Mo Morsi who has been assisting me. For what remains of the coding period of GSoC and also after that, Mo and I thought that it would be a good idea for me to look into adding billing support to the Deltacloud API. I have also been in conversation with mfojitk and marios in this regard. I will be outlining my research and proposal for this in the remaining part of this mail. Currently, Amazon ec2 and GoGrid support programmatic retrieval of billing data though in different formats. [1] outlines how to retrieve billing data from GoGrid. It returns data in xml/json/csv via the REST API. [2] outlines how to activate programmatic billing access for an ec2 account. Essentially, it involves activating programmatic billing access and then specifying an S3 bucket (either new or an existing bucket) where a CSV file containing the usage and billing data will be dumped periodically (in the form of an S3 object). The key for retrieving this S3 object is in the format "account_number-aws-billing-csv-YYYY-MM.csv". I would like to propose adding billing API support for these two providers to start off with and then extending that support as more providers allow for convenient retrieval of billing data. This would essentially require the addition of a new collection, namely the "Billing" collection which has a model that has attributes most common among all the providers. The ec2 and gogrid drivers would then be extended to retrieve the billing data from the respective cloud back-ends. The CSV data from the ec2 provider can be converted to xml/json with the help of a rubygem like fastercsv or similar. I am attaching a sample ec2 billing CSV file for your reference (Thanks to Mo for that). Any suggestions with respect to the billing model and its attributes are welcome and will definitely help. Also, any other suggestions regarding its implementation are also welcome.
Looking forward to your feedback and suggestions, Samridh Student Developer, GSoC [1] https://wiki.gogrid.com/wiki/index.php/API:myaccount.billing.get [2] http://docs.amazonwebservices.com/awsaccountbilling/latest/about/programaccess.html
InvoiceID PayerAccountId LinkedAccountId RecordType RecordID BillingPeriodStartDate BillingPeriodEndDate InvoiceDate PayerAccountName LinkedAccountName TaxationAddress PayerPONumber ProductCode ProductName SellerOfRecord UsageType Operation RateId ItemDescription UsageStartDate UsageEndDate UsageQuantity BlendedRate CurrencyCode CostBeforeTax Credits TaxAmount TaxType TotalCost Estimated <account-id> PayerLineItem 0 2012/08/01 00:00:00 2012/08/31 23:59:59 2012/08/02 13:47:08 Mohammed Morsi <Address> AWSDataTransfer AWS Data Transfer Amazon Web Services LLC. DataTransfer-In-Bytes 235059 $0.000 per GB - data transfer in per month 2012/08/01 00:00:00 2012/08/31 23:59:59 0.00000247 USD 0 0 0 None 0 Estimated <account-id> PayerLineItem 1 2012/08/01 00:00:00 2012/08/31 23:59:59 2012/08/02 13:47:08 Mohammed Morsi <Address> AWSDataTransfer AWS Data Transfer Amazon Web Services LLC. DataTransfer-Out-Bytes 235070 $0.000 per GB - first 1 GB of data transferred out per month 2012/08/01 00:00:00 2012/08/31 23:59:59 0.00000521 USD 0 0 0 None 0 Estimated <account-id> PayerLineItem 2 2012/08/01 00:00:00 2012/08/31 23:59:59 2012/08/02 13:47:08 Mohammed Morsi <Address> AmazonEC2 Amazon Elastic Compute Cloud Amazon Web Services LLC. ElasticIP:IdleAddress 630489 $0.00 per Elastic IP address not attached to a running instance for the first hour 2012/08/01 00:00:00 2012/08/31 23:59:59 1 USD 0 0 0 None 0 Estimated <account-id> PayerLineItem 3 2012/08/01 00:00:00 2012/08/31 23:59:59 2012/08/02 13:47:08 Mohammed Morsi <Address> AmazonEC2 Amazon Elastic Compute Cloud Amazon Web Services LLC. ElasticIP:IdleAddress 630737 $0.005 per Elastic IP address not attached to a running instance per hour (prorated) 2012/08/01 00:00:00 2012/08/31 23:59:59 24 USD 0.12 0 0 None 0.12 Estimated <account-id> PayerLineItem 4 2012/08/01 00:00:00 2012/08/31 23:59:59 2012/08/02 13:47:08 Mohammed Morsi <Address> AmazonS3 Amazon Simple Storage Service Amazon Web Services LLC. Requests-Tier1 279117 $0.01 per 1,000 PUT, COPY, POST, or LIST requests 2012/08/01 00:00:00 2012/08/31 23:59:59 8 USD 0.01 0 0 None 0.01 Estimated <account-id> PayerLineItem 5 2012/08/01 00:00:00 2012/08/31 23:59:59 2012/08/02 13:47:08 Mohammed Morsi <Address> AmazonS3 Amazon Simple Storage Service Amazon Web Services LLC. Requests-Tier2 279156 $0.01 per 10,000 GET and all other requests 2012/08/01 00:00:00 2012/08/31 23:59:59 13 USD 0.01 0 0 None 0.01 Estimated <account-id> InvoiceTotal InvoiceTotal:Estimated 2012/08/01 00:00:00 2012/08/31 23:59:59 2012/08/02 13:47:08 Mohammed Morsi <Address> Total amount for invoice Estimated USD 0.14 0 0 0.14 <account-id> StatementTotal StatementTotal 2012/08/01 00:00:00 2012/08/31 23:59:59 Mohammed Morsi Total statement amount for period 2012/08/01 00:00:00 - 2012/08/31 23:59:59 USD 0.14 0 0 0.14 EstimatedDisclaimer This report reflects your estimated monthly bill for activity through approximately 2012/08/02 10:59:59