Sha256: c2151d89a4bc884bbb128f38f600bafb93bd410ecc265877ece6ce7486741284

Contents?: true

Size: 1.55 KB

Versions: 83

Compression:

Stored size: 1.55 KB

Contents

module Fog
  module Compute
    class OpenStack
      class Real

        def list_usages(date_start = nil, date_end = nil, detailed=false)
          params = Hash.new
          params[:start] = date_start.iso8601.gsub(/\+.*/, '') if date_start
          params[:end]   = date_end.iso8601.gsub(/\+.*/, '')   if date_end
          params[:detailed] = (detailed ? '1' : '0')           if detailed

          request(
            :expects  => [200, 203],
            :method   => 'GET',
            :path     => 'os-simple-tenant-usage',
            :query    => params
          )
        end

      end

      class Mock
        def list_usages(date_start = nil, date_end = nil, detailed=false)
          params = Hash.new
          response        = Excon::Response.new
          response.status = 200
          response.body   = {"tenant_usages"=>[{
                               "total_memory_mb_usage" => 0.00036124444444444445,
                               "total_vcpus_usage"     => 7.055555555555556e-07,
                               "start"                 => "2012-03-06 05:05:56.349001", 
                               "tenant_id"             => "b97c8abba0c44a0987c63b858a4823e5",
                               "stop"                  => "2012-03-06 05:05:56.349255", 
                               "total_hours"           => 7.055555555555556e-07,
                               "total_local_gb_usage"  => 0.0
                                }
                              ]
                            }
          response
        end
      end
    end
  end
end

Version data entries

83 entries across 83 versions & 13 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/openstack/requests/compute/list_usages.rb
cifrado-0.2.1 vendor/fog/lib/fog/openstack/requests/compute/list_usages.rb
cifrado-0.2.0 vendor/fog/lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/openstack/requests/compute/list_usages.rb
fog-1.20.0 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/openstack/requests/compute/list_usages.rb
fog-1.19.0 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/openstack/requests/compute/list_usages.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/openstack/requests/compute/list_usages.rb