Module: XClarityClient::Mixins::EventMixin

Included in:
Client
Defined in:
lib/xclarity_client/mixins/event_mixin.rb

Overview

Exposes EventManagement features

Instance Method Summary collapse

Instance Method Details

#discover_eventsObject



6
7
8
# File 'lib/xclarity_client/mixins/event_mixin.rb', line 6

def discover_events
  EventManagement.new(@config).fetch_all
end

#fetch_events(opts = {}) ⇒ Object



10
11
12
# File 'lib/xclarity_client/mixins/event_mixin.rb', line 10

def fetch_events(opts = {})
  EventManagement.new(@config).get_object_with_opts(opts, Event)
end

#get_last_cn(opts = {}) ⇒ Object



14
15
16
17
18
# File 'lib/xclarity_client/mixins/event_mixin.rb', line 14

def get_last_cn(opts = {})
  headers = EventManagement.new(@config).get_headers_with_opts(opts, Event)
  range = headers['content-range']
  range.slice(range.index('/') + 1, range.length).to_i
end