lib/oci/audit/audit_client.rb
# Returns all the audit events processed for the specified compartment within the specified
# time range.
#
# @param [String] compartment_id The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment.
# @param [DateTime] start_time Returns events that were processed at or after this start date and time, expressed in
#   [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format.
#
#   For example, a start value of `2017-01-15T11:30:00Z` will retrieve a list of all events processed
#   since 30 minutes after the 11th hour of January 15, 2017, in Coordinated Universal Time (UTC).
#   You can specify a value with granularity to the minute. Seconds (and milliseconds, if included) must
#   be set to `0`.
#
# @param [DateTime] end_time Returns events that were processed before this end date and time, expressed in
#   [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format.
#
#   For example, a start value of `2017-01-01T00:00:00Z` and an end value of `2017-01-02T00:00:00Z`
#   will retrieve a list of all events processed on January 1, 2017. Similarly, a start value of
#   `2017-01-01T00:00:00Z` and an end value of `2017-02-01T00:00:00Z` will result in a list of all
#   events processed between January 1, 2017 and January 31, 2017. You can specify a value with
#   granularity to the minute. Seconds (and milliseconds, if included) must be set to `0`.
#
# @param [Hash] opts the optional parameters
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
#   retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
# @option opts [String] :page For list pagination. The value of the `opc-next-page` response header from the previous \"List\" call.
#   For important details about how pagination works, see [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
#
# @option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
#   particular request, please provide the request ID.
#
# @return [Response] A Response object with data of type Array<{OCI::Audit::Models::AuditEvent AuditEvent}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/audit/list_events.rb.html) to see an example of how to use list_events API.
Returns all the audit events processed for the specified compartment within the specified
time range.
Returns all the audit events processed for the specified compartment within the specified time range .
def list_events(compartment_id, start_time, end_time, opts = {})
      logger.debug 'Calling operation AuditClient#list_events.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_events." if compartment_id.nil?
      raise "Missing the required parameter 'start_time' when calling list_events." if start_time.nil?
      raise "Missing the required parameter 'end_time' when calling list_events." if end_time.nil?
      path = '/auditEvents'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:startTime] = start_time
      query_params[:endTime] = end_time
      query_params[:page] = opts[:page] if opts[:page]
      header_params = {}
      header_params[:accept] = 'application/json'
      header_params[:'content-type'] = 'application/json'
      header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
      post_body = nil
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AuditClient#list_events') do
        @api_client.call_api(
          :GET,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body,
          return_type: 'Array<OCI::Audit::Models::AuditEvent>'
        )
      end
    end
def list_events ( compartment_id , start_time , end_time , opts = { } ) logger . debug 'Calling operation AuditClient#list_events.' if logger raise "Missing the required parameter 'compartment_id' when calling list_events." if compartment_id . nil? raise "Missing the required parameter 'start_time' when calling list_events." if start_time . nil? raise "Missing the required parameter 'end_time' when calling list_events." if end_time . nil? path = '/auditEvents' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :startTime ] = start_time query_params [ :endTime ] = end_time query_params [ :page ] = opts [ :page ] if opts [ :page ] header_params = { } header_params [ :accept ] = 'application/json' header_params [ :' content-type ' ] = 'application/json' header_params [ :' opc-request-id ' ] = opts [ :opc_request_id ] if opts [ :opc_request_id ] post_body = nil OCI :: Retry . make_retrying_call ( applicable_retry_config ( opts ) , call_name : 'AuditClient#list_events' ) do @api_client . call_api ( :GET , path , endpoint , header_params : header_params , query_params : query_params , operation_signing_strategy : operation_signing_strategy , body : post_body , return_type : 'Array<OCI::Audit::Models::AuditEvent>' ) end end
Returns all the audit events processed for the specified compartment within the specified
time range.
Returns all the audit events processed for the specified compartment within the specified time range .
# rubocop:disable Style/NegatedIf # Query Params # Header Params # rubocop:enable Style/NegatedIf # rubocop:disable Metrics/BlockLength # rubocop:enable Metrics/BlockLength
A Response object with data of type Array<{OCI::Audit::Models::AuditEvent AuditEvent}>
A Response object with data of type Array< { OCI :: Audit :: Models :: AuditEvent AuditEvent } >
Response
compartment_id
start_time
end_time
opts
:opc_request_id Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
: opc_request_id Unique Oracle - assigned identifier for the request . If you need to contact Oracle about a particular request please provide the request ID .
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_events API.
Click [ here ] to see an example of how to use list_events API .