deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark McLoughlin <>
Subject Re: Proposal: Adding billing API support to Deltacloud
Date Thu, 09 Aug 2012 07:30:39 GMT

On Mon, 2012-08-06 at 18:56 +0530, samridh srinath wrote:
> 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 spent a little while thinking about this some time back and wrote down
some notes quickly. I've added them below FWIW.

The place I'd like to eventually see us get to is that clouds would
provide historical metering data and the cost basis applied to those
meters. So, rather than just "you've spent $200 on instances this week"
you get enough information to calculate the bill yourself.

Now, it looks like AWS is a long way from that but I could see OpenStack
get there soon enough, so it'd be nice if we could design the API to
allow for it in the future.

I guess the summary is there are at least three things worth modelling -
meters, rates and billing.


     GET /api HTTP/1.1
     Accept: application/xml

     HTTP/1.1 200 OK
     Content-Type: application/xml

       <link rel="meters" href="/api/meters?start={start}&end={end}"/>
       <link rel="costmodels" href="/api/costmodels"/>
       <link rel="currencies" href="/api/currrencies"/>

 - meters: current and historical information on resource usage

     GET /api/meters?start=2010-10-01&end=2010-10-31 HTTP/1.1
     Accept: application/xml

     HTTP/1.1 200 OK
     Content-Type: application/xml

     <meters start="2010-10-01T00:00:00" end="2010-10-01T00:00:00">
       <meter id="instance.inst1.uptime" href="/api/meters/instance.inst1.uptime">
         <name>Instance1 Running Time</name>
         <description>Number of hours Instance1 is running</description>
         <value units="hours">42</value>
         <instance id="inst1" href="/api/instances/inst1"/>
         <link rel="rates" href="/api/meters/instance.inst1.uptime/rates"/>
         <link rel="samples" href="/api/meters/instance.inst1.uptime/samples"/>
       <meter id="instance.inst2.uptime" href="/api/meters/instance.inst2.uptime">
         <name>Instance2 Running Time</name>
         <description>Number of hours Instance2 is running</description>
         <value units="hours">156</value>
         <instance id="inst1" href="/api/instances/inst2"/>
         <link rel="rates" href="/api/meters/instance.inst2.uptime/rates"/>
         <link rel="samples" href="/api/meters/instance.inst2.uptime/samples"/>
       <meter id="network.rx" href="/api/meters/network.rx">
         <name>Network Data In</name>
         <description>Number of Gb network data received</description>
         <value units="Gb">15.3</value>
         <link rel="rates" href="/api/meters/network.rx/rates"/>
         <link rel="samples" href="/api/meters/network.rx/samples"/>
       <meter id="network.tx" href="/api/meters/network.tx">
         <name>Network Data Out</name>
         <description>Number of Gb network data transmitted</description>
         <value units="Gb">38.2</value>
         <link rel="rates" href="/api/meters/network.tx/rates"/>
         <link rel="samples" href="/api/meters/network.tx/samples"/>
       <meter id="ebs.provisioned" href="/api/meters/ebs.provisioned">
         <name>EBS Storage Provisioned</name>
         <description>Number of Gb allocated in EBS storage</description>
         <value units="Gb">40.0</value>
         <link rel="rates" href="/api/meters/ebs.provisioned/rates"/>
         <link rel="samples" href="/api/meters/ebs.provisioned/samples"/>
       <meter id="ebs.ios" href="/api/meters/ebs.ios">
         <name>EBS Storage I/Os</name>
         <description>Number of EBS I/O operations</description>
         <link rel="rates" href="/api/meters/ebs.ios/rates"/>
         <link rel="samples" href="/api/meters/ebs.ios/samples"/>


     GET /api/meters/instance.inst1.uptime/samples?start=2010-10-01&end=2010-10-31 HTTP/1.1
     Accept: application/xml

     HTTP/1.1 200 OK
     Content-Type: application/xml

       <meter id="instance.inst1.uptime" href="/api/meters/instance.ints1.uptime"/>
       <sample start="2010-10-16T00:00:00" end="2010-10-16T23:59:59">
       <sample start="2010-10-17T00:00:00" end="2010-10-17T23:59:59">
       <sample start="2010-10-18T00:00:00" end="2010-10-18T23:59:59">


     GET /api/meters/network.tx/samples?start=2010-10-01&end=2010-10-31 HTTP/1.1
     Accept: application/xml

     HTTP/1.1 200 OK
     Content-Type: application/xml

       <meter id="network.tx" href="/api/meters/network.tx"/>
       <sample start="2010-10-01T00:00:00" end="2010-10-01T23:59:59">
       <sample start="2010-10-02T00:00:00" end="2010-10-02T23:59:59">
       <sample start="2010-10-03T00:00:00" end="2010-10-03T23:59:59">

 - cost model - defines the costs a user incurs by using various resources

     GET /api/costmodels HTTP/1.1
     Accept: application/xml

     HTTP/1.1 200 OK
     Content-Type: application/xml

       <cost_model id="eu-small" href="/api/costmodels/eu-small">
         <name>EU Small Instances</name>
         <description>Cost model for small EC2 instances in the EU region</description>
         <currency id="euro" href="/api/currencies/euro"/>
         <link rel="rates" href="/api/costmodels/eu-small/rates"/>
       <cost_model id="us-network" href="/api/costmodels/us-network">
         <name>US Network I/O</name>
         <description>Cost model for network I/O in the US region</description>
         <currency id="usd" href="/api/currencies/usd"/>
         <link rel="rates" href="/api/costmodels/us-network/rates"/>


     GET /api/costmodels/eu-small/rates HTTP/1.1
     Accept: application/xml

     HTTP/1.1 200 OK
     Content-Type: application/xml

       <rate id="7" href="/api/costmodels/eu-small/rates/7">
         <duration id="hourly" href="/api/durations/hourly"/>
       <rate id="8" href="/api/costmodels/eu-small/rates/8">
         <duration id="hourly" href="/api/durations/hourly"/>

View raw message