Sha256: b3f9261776d110720535897df7b4a82ec46380adeaab08025c6a12dbce391832

Contents?: true

Size: 1.39 KB

Versions: 2

Compression:

Stored size: 1.39 KB

Contents

# coding: utf-8
#
# Author:: Dangleterre Michaël
# © Copyright ArubaCloud.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#

require 'fog/arubacloud/service'
require 'fog/arubacloud/error'
require 'benchmark'


module Fog
  module ArubaCloud
    class Compute
      class Real
        def get_notifications(data)
          body = self.body('GetLoadBalancerNotifications').merge(
              :request => {
                  :loadBalancerID => data[:id],
                  :EndDate => data[:endtime],
                  :StartDate => data[:starttime],
                  :LoadBalancerRuleID => data[:ruleid]
              }
          )
          response = nil
          time = Benchmark.realtime {
            response = request(body , 'GetLoadBalancerNotifications', 'GetLoadBalancerNotifications Error')
          }
          Fog::Logger.debug("GetLoadBalancerNotifications time: #{time}")
          if response['Success']
            response
          else
            raise Fog::ArubaCloud::Errors::RequestError.new('Error during the request.')
          end
        end # get_notifications

        class Mock
          def get_notifications
            raise Fog::Errors::MockNotImplemented.new(
                      'Mock not implemented. Feel free to contribute.'
                  )
          end # get_notifications
        end # Mock
      end # Real

    end # Compute
  end # ArubaCloud
end # Fog

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-arubacloud-0.0.6 lib/fog/arubacloud/compute/requests/get_notifications.rb
fog-arubacloud-0.0.5 lib/fog/arubacloud/compute/requests/get_notifications.rb