Class: Conversant::V3::Services::CDN::Audit

Inherits:
Object
  • Object
show all
Defined in:
lib/conversant/v3/services/cdn/audit.rb,
sig/conversant/v3/services/cdn.rbs

Overview

Audit service for CDN activity logging

Provides access to audit logs and compliance tracking for CDN configuration changes and administrative actions.

Examples:

View audit logs

cdn = Conversant::V3.cdn(12345)

logs = cdn.audit.list({
  startTime: "2025-01-01T00:00:00Z",
  endTime: "2025-01-01T23:59:59Z",
  pageSize: 100,
  pageNumber: 0
})

logs.each do |log|
  puts "#{log['timestamp']}: #{log['action']} by #{log['user']}"
end

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ Audit

Initialize audit service

Parameters:

  • parent (CDN)

    the parent CDN service instance

Since:

  • 1.0.0



34
35
36
# File 'lib/conversant/v3/services/cdn/audit.rb', line 34

def initialize(parent)
  @parent = parent
end

Instance Attribute Details

#parentCDN (readonly)

Returns the parent CDN service instance.

Returns:

  • (CDN)

    the parent CDN service instance

Since:

  • 1.0.0



29
30
31
# File 'lib/conversant/v3/services/cdn/audit.rb', line 29

def parent
  @parent
end

Instance Method Details

#delivery_domain_operationsArray[Hash[String, untyped]]

Parameters:

  • payload (Hash[Symbol, untyped])

Returns:

  • (Array[Hash[String, untyped]])

Since:

  • 1.0.0



73
# File 'sig/conversant/v3/services/cdn.rbs', line 73

def delivery_domain_operations: (Hash[Symbol, untyped] payload) -> Array[Hash[String, untyped]]

#list(payload) ⇒ Array

Get audit log entries

Examples:

Get recent audit logs

logs = cdn.audit.list({
  startTime: "2025-01-01T00:00:00Z",
  endTime: "2025-01-01T23:59:59Z",
  pageSize: 100,
  pageNumber: 0
})
logs.each { |log| puts "#{log['timestamp']}: #{log['action']} by #{log['user']}" }

Parameters:

  • payload (Hash)

    audit query parameters

Options Hash (payload):

  • :startTime (String)

    start time for audit logs

  • :endTime (String)

    end time for audit logs

  • :action (String)

    specific action to filter by

  • :user (String)

    user ID to filter by

  • :pageSize (Integer)

    number of results per page

  • :pageNumber (Integer)

    page number (0-based)

Returns:

  • (Array)

    array of audit log entries, or empty array on error

Since:

  • 1.0.0



60
61
62
63
64
65
66
# File 'lib/conversant/v3/services/cdn/audit.rb', line 60

def list(payload)
  response = JSON.parse(@parent.send(:call, 'POST', '/api/audit_list', payload))
  response&.[]('list') || []
rescue StandardError => e
  @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.message}"
  []
end

#loggerObject

Returns:

  • (Object)

Since:

  • 1.0.0



77
# File 'sig/conversant/v3/services/cdn.rbs', line 77

def logger: () -> untyped