lib/azure/armrest/insights/event_service.rb in azure-armrest-0.0.9 vs lib/azure/armrest/insights/event_service.rb in azure-armrest-0.1.0
- old
+ new
@@ -5,20 +5,14 @@
# Insights namespace
module Insights
# Base class for managing events.
class EventService < ArmrestService
- # The provider used in requests when gathering Event information.
- attr_reader :provider
-
# Create and return a new EventService instance.
#
- def initialize(_armrest_configuration, options = {})
- super
- @provider = options[:provider] || 'Microsoft.Insights'
- set_service_api_version(options, 'eventtypes')
- @service_name = 'eventTypes'
+ def initialize(armrest_configuration, options = {})
+ super(armrest_configuration, 'eventTypes', 'Microsoft.Insights', options)
end
# Returns a list of management events for the current subscription.
# The +filter+ option can be used to filter the result set. Additionally,
# you may restrict the results to only return certain fields using
@@ -51,18 +45,19 @@
private
def build_url(filter = nil, select = nil)
sub_id = armrest_configuration.subscription_id
- url = File.join(
- Azure::Armrest::COMMON_URI,
- sub_id,
- 'providers',
- @provider,
- 'eventtypes',
- 'management',
- 'values'
- )
+ url =
+ File.join(
+ Azure::Armrest::COMMON_URI,
+ sub_id,
+ 'providers',
+ provider,
+ 'eventtypes',
+ 'management',
+ 'values'
+ )
url << "?api-version=#{@api_version}"
url << "&$filter=#{filter}" if filter
url << "&$select=#{select}" if select