lib/azure/armrest/insights/event_service.rb
# 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
# the +select+ option. The possible fields for both filtering and selection
# are:
#
# authorization, channels, claims, correlationId, description, eventDataId,
# eventName, eventSource, eventTimestamp, httpRequest, level, operationId,
# operationName, properties, resourceGroupName, resourceProviderName,
# resourceUri, status, submissionTimestamp, subStatus and subscriptionId.
#
# The +skip_token+ option can be used to grab the next batch of events
# when the first call reaches the maximum number of events that the API
# can return in one batch (API default 200). You may also set the :all
# option to true, in which case all batches will automatically be
# collected for you.
#
# In practice you should always set a filter for eventTimestamp because
# you are restricted to 90 days worth of events. If you do not set the
# filter and/or you try to retrieve more than 90 days worth of events
# then you will get an error. This is a limitation of the Azure API.
#
# Example:
#
#   ies = Azure::Armrest::Insights::EventService.new(conf)
#
#   date   = (Time.now - 86400).httpdate
#   filter = "eventTimestamp ge #{date} and eventChannels eq 'Admin, Operation'"
#   select = "resourceGroupName, operationName"
#
#   ies.list(:filter => filter, :select => select, :all => true).each{ |event|
#     p event
#   }
#
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
the +select+ option. The possible fields for both filtering and selection
are.

authorization, channels, claims, correlationId, description, eventDataId,
eventName, eventSource, eventTimestamp, httpRequest, level, operationId,
operationName, properties, resourceGroupName, resourceProviderName,
resourceUri, status, submissionTimestamp, subStatus and subscriptionId.

The +skip_token+ option can be used to grab the next batch of events
when the first call reaches the maximum number of events that the API
can return in one batch (API default 200). You may also set the :all
option to true, in which case all batches will automatically be
collected for you.

In practice you should always set a filter for eventTimestamp because
you are restricted to 90 days worth of events. If you do not set the
filter and/or you try to retrieve more than 90 days worth of events
then you will get an error. This is a limitation of the Azure API.





date   = (Time.now - 86400).httpdate
filter = "eventTimestamp ge #{date} and eventChannels eq 'Admin, Operation'"
select = "resourceGroupName, operationName"

ies.list(:filter => filter, :select => select, :all => true).each{ |event|
p event
}
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 the + select + option . The possible fields for both filtering and selection are . authorization channels claims correlationId description eventDataId eventName eventSource eventTimestamp httpRequest level operationId operationName properties resourceGroupName resourceProviderName resourceUri status submissionTimestamp subStatus and subscriptionId . The + skip_token + option can be used to grab the next batch of events when the first call reaches the maximum number of events that the API can return in one batch ( API default 200 ) . You may also set the : all option to true in which case all batches will automatically be collected for you . In practice you should always set a filter for eventTimestamp because you are restricted to 90 days worth of events . If you do not set the filter and / or you try to retrieve more than 90 days worth of events then you will get an error . This is a limitation of the Azure API . date = ( Time . now - 86400 ) . httpdate filter = " eventTimestamp ge # { date } and eventChannels eq ' Admin Operation ' " select = " resourceGroupName operationName " ies . list ( : filter = > filter : select = > select : all = > true ) . each { |event| p event }
def list(options = {})
          url = build_url(options)
          response = rest_get(url)
          klass  = Azure::Armrest::Insights::Event
          events = Azure::Armrest::ArmrestCollection.create_from_response(response, klass)
          if options[:all] && events.continuation_token
            events.push(*list(options.merge(:skip_token => events.continuation_token)))
            events.continuation_token = nil 
          end
          events
        end
def list ( options = { } ) url = build_url ( options ) response = rest_get ( url ) klass = Azure :: Armrest :: Insights :: Event events = Azure :: Armrest :: ArmrestCollection . create_from_response ( response , klass ) if options [ :all ] && events . continuation_token events . push ( * list ( options . merge ( :skip_token => events . continuation_token ) ) ) events . continuation_token = nil end events end
Returns a list of management events for the current subscription.
Returns a list of management events for the current subscription .
# Clear when finished
options
<not_specific>