Sha256: aadfb88ac9542c4708852ce3241703a4342f405759e8ab6277ce08a0828e2fdd

Contents?: true

Size: 1011 Bytes

Versions: 35

Compression:

Stored size: 1011 Bytes

Contents

require 'redhat_access_lib'
require 'forwardable'

module RedhatAccess
  module Telemetry
    class PortalClient < RedHatSupportLib::TelemetryApi::Client
      extend Forwardable
      include RedhatAccess::Telemetry::LookUps
      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"

      delegate [:get_machines,:get_auth_opts,:get_current_organization] => :@context

      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

      # Returns the branch id of the current org/account
      def get_branch_id
        organization = get_current_organization
        return get_branch_id_for_org(organization)
      end

    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
redhat_access-2.2.7 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.1.10 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.0.17 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.0.16 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.1.9 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.2.6 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.0.15 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.1.8 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.2.5 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.2.4 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.2.3 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.0.14 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.1.7 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.2.2 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.2.0 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.1.6 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.1.5 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.1.4 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.1.3 app/services/redhat_access/telemetry/portal_client.rb
redhat_access-2.1.2 app/services/redhat_access/telemetry/portal_client.rb