# File lib/fog/event/openstack.rb, line 91 def initialize(options = {}) initialize_identity options @openstack_service_type = options[:openstack_service_type] || ['event'] @openstack_service_name = options[:openstack_service_name] @openstack_endpoint_type = options[:openstack_endpoint_type] || 'publicURL' @connection_options = options[:connection_options] || {} authenticate set_api_path @persistent = options[:persistent] || false @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) end
# File lib/fog/event/openstack.rb, line 87 def self.not_found_class Fog::Event::OpenStack::NotFound end
# File lib/fog/event/openstack/requests/get_event.rb, line 5 def get_event(message_id) request( :expects => 200, :method => 'GET', :path => "events/#{message_id}" ) end
# File lib/fog/event/openstack/requests/list_events.rb, line 5 def list_events(options = []) data = { 'q' => [] } options.each do |opt| filter = {} ['field', 'op', 'value'].each do |key| filter[key] = opt[key] if opt[key] end data['q'] << filter unless filter.empty? end request( :body => Fog::JSON.encode(data), :expects => 200, :method => 'GET', :path => 'events' ) end
# File lib/fog/event/openstack.rb, line 107 def set_api_path unless @path.match(SUPPORTED_VERSIONS) @path = "/" + Fog::OpenStack.get_supported_version( SUPPORTED_VERSIONS, @openstack_management_uri, @auth_token, @connection_options ) end end