Class: Conversant::V3::Services::LMS::Partner::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/conversant/v3/services/lms/partner/report.rb

Overview

LMS Report analytics for detailed partner-level reporting

Provides detailed reporting methods for transcoding, recording, jobs, DRM analytics, and business usage data.

Since:

  • 1.0.15

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ Report

Initialize partner LMS report service

Parameters:

Since:

  • 1.0.15



21
22
23
# File 'lib/conversant/v3/services/lms/partner/report.rb', line 21

def initialize(parent)
  @parent = parent
end

Instance Attribute Details

#parentConversant::V3::Services::LMS::Partner::Analytics (readonly)

Returns the parent analytics instance.

Returns:

Since:

  • 1.0.15



16
17
18
# File 'lib/conversant/v3/services/lms/partner/report.rb', line 16

def parent
  @parent
end

Instance Method Details

#bussiness_live_usage(payload) ⇒ Hash?

Fetches business live usage data

Retrieves business-level live streaming usage data aggregated by month, including filtering by customer type and metric selection type.

Examples:

Get live duration for January 2025

report = lms.partner.analytics.report
data = report.bussiness_live_usage(month: '202501', selectType: 'ltd', customerType: '2')

Parameters:

  • payload (Hash)

    Parameters for the query

Options Hash (payload):

  • :month (String)

    month in YYYYMM format (e.g., '202501' for January 2025)

  • :selectType (String)

    select type filter ('ltd' for live duration, 'rtd' for recording, 'ltn' for job count)

  • :customerType (String)

    customer type filter (e.g., '2' for standard customers)

Returns:

  • (Hash, nil)

    Business live usage data with detailed metrics, or nil on error

Since:

  • 1.0.15



146
147
148
149
150
151
152
153
154
# File 'lib/conversant/v3/services/lms/partner/report.rb', line 146

def bussiness_live_usage(payload)
  response = @parent.instance_variable_get(:@parent).send(:call, 'GET', "/v4/reporting/lms/business/usage/search?#{payload.to_query}")
  return nil if response.nil?

  JSON.parse(response)
rescue StandardError => e
  logger.error "#{identifier}.METHOD:#{__method__}.EXCEPTION:#{e.message}"
  nil
end

#duration_v2_transcoding(payload) ⇒ Hash?

Fetches v2 transcoding duration data

Retrieves transcoding duration metrics using the v2 API endpoint. This provides backward compatibility with the legacy reporting format.

Examples:

Get v2 transcoding duration

report = lms.partner.analytics.report
data = report.duration_v2_transcoding(startTime: '2025-01-01', endTime: '2025-01-31')

Parameters:

  • payload (Hash)

    Parameters for the query

Options Hash (payload):

  • :startTime (String)

    start time in ISO 8601 format or timestamp

  • :endTime (String)

    end time in ISO 8601 format or timestamp

Returns:

  • (Hash, nil)

    Transcoding duration data in v2 format, or nil on error

Since:

  • 1.0.15



119
120
121
122
123
124
125
126
127
# File 'lib/conversant/v3/services/lms/partner/report.rb', line 119

def duration_v2_transcoding(payload)
  response = @parent.instance_variable_get(:@parent).send(:call, 'GET', "/v2/reporting/lms/transcoding/duration?#{payload.to_query}")
  return nil if response.nil?

  JSON.parse(response)
rescue StandardError => e
  logger.error "#{identifier}.METHOD:#{__method__}.EXCEPTION:#{e.message}"
  nil
end

#jobs(payload) ⇒ Hash?

Fetches transcoding jobs count analytics

Retrieves the number of transcoding jobs executed within a specified time range, useful for understanding service usage patterns and billing.

Examples:

Get job counts for a time range

report = lms.partner.analytics.report
data = report.jobs(startTime: '2025-01-01', endTime: '2025-01-31')

Parameters:

  • payload (Hash)

    Parameters for the query

Options Hash (payload):

  • :startTime (String)

    start time in ISO 8601 format or timestamp

  • :endTime (String)

    end time in ISO 8601 format or timestamp

Returns:

  • (Hash, nil)

    Jobs count data by time period, or nil on error

Since:

  • 1.0.15



93
94
95
96
97
98
99
100
101
# File 'lib/conversant/v3/services/lms/partner/report.rb', line 93

def jobs(payload)
  response = @parent.instance_variable_get(:@parent).send(:call, 'GET', "/reporting/lms/transcoding/number?#{payload.to_query}")
  return nil if response.nil?

  JSON.parse(response)
rescue StandardError => e
  logger.error "#{identifier}.METHOD:#{__method__}.EXCEPTION:#{e.message}"
  nil
end

#recordings(payload) ⇒ Hash?

Fetches recording analytics data

Retrieves detailed recording duration metrics for live streaming recordings, including breakdown by codec and resolution for billing purposes.

Examples:

Get recording data for a time range

report = lms.partner.analytics.report
data = report.recordings(startTime: '2025-01-01', endTime: '2025-01-31')

Parameters:

  • payload (Hash)

    Parameters for the query

Options Hash (payload):

  • :startTime (String)

    start time in ISO 8601 format or timestamp

  • :endTime (String)

    end time in ISO 8601 format or timestamp

Returns:

  • (Hash, nil)

    Recording duration data with codec breakdown, or nil on error

Since:

  • 1.0.15



67
68
69
70
71
72
73
74
75
# File 'lib/conversant/v3/services/lms/partner/report.rb', line 67

def recordings(payload)
  response = @parent.instance_variable_get(:@parent).send(:call, 'GET', "/reporting/lms/recording/duration?#{payload.to_query}")
  return nil if response.nil?

  JSON.parse(response)
rescue StandardError => e
  logger.error "#{identifier}.METHOD:#{__method__}.EXCEPTION:#{e.message}"
  nil
end

#transcodings(payload) ⇒ Hash?

Fetches transcoding analytics data

Retrieves detailed transcoding duration metrics for live streaming services, useful for billing calculations and capacity planning.

Examples:

Get transcoding data for a time range

report = lms.partner.analytics.report
data = report.transcodings(startTime: '2025-01-01', endTime: '2025-01-31')

Parameters:

  • payload (Hash)

    Parameters for the query

Options Hash (payload):

  • :startTime (String)

    start time in ISO 8601 format or timestamp

  • :endTime (String)

    end time in ISO 8601 format or timestamp

Returns:

  • (Hash, nil)

    Transcoding duration data with breakdown by resolution and codec, or nil on error

Since:

  • 1.0.15



41
42
43
44
45
46
47
48
49
# File 'lib/conversant/v3/services/lms/partner/report.rb', line 41

def transcodings(payload)
  response = @parent.instance_variable_get(:@parent).send(:call, 'GET', "/reporting/lms/transcoding/duration?#{payload.to_query}")
  return nil if response.nil?

  JSON.parse(response)
rescue StandardError => e
  logger.error "#{identifier}.METHOD:#{__method__}.EXCEPTION:#{e.message}"
  nil
end