Class: Conversant::V3::Services::VMS
- Includes:
- Authorization
- Defined in:
- lib/conversant/v3/services/vms.rb,
lib/conversant/v3/services/vms/partner.rb,
lib/conversant/v3/services/vms/business.rb,
lib/conversant/v3/services/vms/analytics.rb,
lib/conversant/v3/services/vms/transcoding.rb,
lib/conversant/v3/services/vms/partner/business.rb,
lib/conversant/v3/services/vms/partner/analytics.rb,
sig/conversant/v3/services/vms.rbs
Overview
VMS (Video Management System) service
Defined Under Namespace
Classes: Analytics, Business, Partner, Transcoding, VodTranscoding
Constant Summary
Constants included from HttpClient
HttpClient::PORTAL_SESSION_REDIS_KEY, HttpClient::SSO_GW_SESSION2_REDIS_KEY
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#analytics ⇒ Analytics
Get analytics service instance.
-
#business ⇒ Business
Get business metrics service instance.
- #fetch_new_session ⇒ String?
-
#partner ⇒ Partner
Get partner service instance.
-
#partner_analytics ⇒ VMS::Partner::Analytics
deprecated
Deprecated.
Use #partner instead
- #requires_session? ⇒ Boolean
- #service_endpoint ⇒ String
- #session_cookie_name ⇒ String
-
#transcoding ⇒ Transcoding
Get transcoding service instance.
-
#vod_transcoding ⇒ VodTranscoding
Service accessors.
Methods included from Authorization
#authorize, #authorized_headers, #base_headers, #build_cookie_hash, #build_headers_with_cookies, #cached_session, #fetch_session_cookie, #fetch_sso_session, #format_cookies, #log_missing_session, #session_cache_key, #sso_cache_key
Methods inherited from Base
#configuration, #identifier, #initialize, #logger, #portal_endpoint, #redis, #sso_endpoint, #validate_configuration!
Methods included from HttpClient
#add_cookies_to_headers, #authenticate, #configuration, #cookie_jar, #cookie_jar=, #debug_log, #extract_form_action, #http_get, #http_post, #login_url, #parse_cookie_to_jar, #redis, #request, #sso_login, #update_cookie_jar
Constructor Details
This class inherits a constructor from Conversant::V3::Base
Instance Method Details
#analytics ⇒ Analytics
Get analytics service instance
40 41 42 |
# File 'lib/conversant/v3/services/vms.rb', line 40 def analytics @analytics ||= Analytics.new(self) end |
#business ⇒ Business
Get business metrics service instance
48 49 50 |
# File 'lib/conversant/v3/services/vms.rb', line 48 def business @business ||= Business.new(self) end |
#fetch_new_session ⇒ String?
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/conversant/v3/services/vms.rb', line 102 def fetch_new_session sessions = authenticate return nil unless sessions && sessions[:session] && sessions[:sso_gw_session2] = (Time.now.to_f * 1000).to_i reporting_url = "#{configuration.private_vms_endpoint}/reporting/vms/federation/business/usage" reporting_url += "?customerId=#{customer_id}&type=#{type || 2}&t=#{}" logger.debug "#{identifier}.METHOD:authorize.REQUESTING_JSESSIONID" response = RestClient.get( reporting_url, { authority: URI.parse(configuration.private_vms_endpoint).hostname, referer: portal_endpoint, user_agent: configuration.default_ua, cookies: { 'SESSION': sessions[:session], 'SSO_GW_SESSION2': sessions[:sso_gw_session2] }, timeout: 30, open_timeout: 30 } ) if response.['JSESSIONID'] jsessionid = response.['JSESSIONID'] redis.set(session_cache_key, jsessionid, ex: configuration.cache_ttl) logger.debug "#{identifier}.METHOD:authorize.JSESSIONID_OBTAINED" jsessionid else logger.error "#{identifier}.METHOD:authorize.NO_JSESSIONID_IN_RESPONSE" nil end rescue RestClient::Unauthorized, RestClient::Forbidden => e logger.error "#{identifier}.METHOD:authorize.AUTH_ERROR:#{e.}" nil rescue StandardError => e logger.error "#{identifier}.METHOD:authorize.ERROR:#{e.}" nil end |
#partner ⇒ Partner
Get partner service instance
Provides access to partner-level analytics for Video Management System that aggregate data across multiple customer accounts.
63 64 65 |
# File 'lib/conversant/v3/services/vms.rb', line 63 def partner @partner ||= Partner.new(self) end |
#partner_analytics ⇒ VMS::Partner::Analytics
Use #partner instead
Get partner analytics service instance (deprecated)
73 74 75 |
# File 'lib/conversant/v3/services/vms.rb', line 73 def partner_analytics @partner_analytics ||= Partner::Analytics.new(self) end |
#requires_session? ⇒ Boolean
154 155 156 |
# File 'lib/conversant/v3/services/vms.rb', line 154 def requires_session? true end |
#service_endpoint ⇒ String
146 147 148 |
# File 'lib/conversant/v3/services/vms.rb', line 146 def service_endpoint configuration.private_vms_endpoint end |
#session_cookie_name ⇒ String
150 151 152 |
# File 'lib/conversant/v3/services/vms.rb', line 150 def 'JSESSIONID' end |
#transcoding ⇒ Transcoding
Get transcoding service instance
32 33 34 |
# File 'lib/conversant/v3/services/vms.rb', line 32 def transcoding @transcoding ||= Transcoding.new(self) end |
#vod_transcoding ⇒ VodTranscoding
Service accessors
51 |
# File 'sig/conversant/v3/services/vms.rbs', line 51
def vod_transcoding: () -> VodTranscoding
|