Class: RedhatAccess::Telemetry::PortalClient

Inherits:
RedHatSupportLib::TelemetryApi::Client
  • Object
show all
Extended by:
Forwardable
Includes:
LookUps
Defined in:
app/services/redhat_access/telemetry/portal_client.rb

Constant Summary collapse

UPLOAD_HOST =
REDHAT_ACCESS_CONFIG[:telemetry_upload_host]
API_HOST =
REDHAT_ACCESS_CONFIG[:telemetry_api_host]
UPLOAD_URL =
"#{UPLOAD_HOST}/r/insights/uploads"
STRATA_URL =
"#{API_HOST}/r/insights"

Instance Method Summary collapse

Methods included from LookUps

#can_mask_rules, #can_unregister_system, #current_organization_object, #disconnected_org?, #get_basic_auth_options, #get_branch_id_for_org, #get_branch_id_for_uuid, #get_content_host, #get_content_hosts, #get_default_ssl_ca_file, #get_http_options, #get_http_user_agent, #get_leaf_id, #get_mutual_tls_auth_options, #get_organization, #get_plugin_parent_name, #get_plugin_parent_version, #get_portal_http_proxy, #get_rha_plugin_name, #get_rha_plugin_rpm_name, #get_rha_plugin_version, #get_ssl_options_for_org, #get_ssl_options_for_uuid, #get_tapi_timeout, #get_telemetry_config, #get_upload_timeout, #insights_api_host, #is_org_selected?, #is_susbcribed_to_redhat?, #telemetry_enabled?, #telemetry_enabled_for_uuid?, #upstream_owner, #use_basic_auth?, #use_subsets?, #user_login_to_hash

Constructor Details

#initialize(upload_url, strata_url, creds, context, optional) ⇒ PortalClient

Returns a new instance of PortalClient.



16
17
18
19
20
21
# File 'app/services/redhat_access/telemetry/portal_client.rb', line 16

def initialize(upload_url, strata_url, creds, context, optional)
  upload_url = UPLOAD_URL if upload_url.nil?
  strata_url = STRATA_URL if strata_url.nil?
  super(upload_url, strata_url, creds, optional)
  @context = context
end

Instance Method Details

#call_tapi(original_method, resource, original_params, original_payload, extra, use_subsets = true) ⇒ Object

intercept call_tapi() so we can override use of subsets



24
25
26
# File 'app/services/redhat_access/telemetry/portal_client.rb', line 24

def call_tapi(original_method, resource, original_params, original_payload, extra, use_subsets = true)
  super(original_method, resource, original_params, original_payload, extra, use_subsets? && use_subsets)
end

#get_branch_idObject

Returns the branch id of the current org/account



29
30
31
32
# File 'app/services/redhat_access/telemetry/portal_client.rb', line 29

def get_branch_id
  organization = get_current_organization
  return get_branch_id_for_org(organization)
end