Class: Katello::Resources::Registry::RegistryResource

Inherits:
HttpResource
  • Object
show all
Defined in:
app/lib/katello/resources/registry.rb

Constant Summary

Constants inherited from HttpResource

HttpResource::REQUEST_MAP

Instance Attribute Summary

Attributes inherited from HttpResource

#json

Class Method Summary collapse

Methods inherited from HttpResource

#[], #[]=, hash_to_query, #initialize, issue_request, join_path, raise_rest_client_exception, rest_client

Methods included from Concerns::FilterSensitiveData

#filter_sensitive_data

Constructor Details

This class inherits a constructor from Katello::HttpResource

Class Method Details

.load_classObject



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'app/lib/katello/resources/registry.rb', line 48

def load_class
  pulp_primary = ::SmartProxy.pulp_primary
  content_app_url = pulp_primary.setting(SmartProxy::PULP3_FEATURE, 'content_app_url')

  fail Errors::ContainerRegistryNotConfigured unless content_app_url

  uri = URI.parse(content_app_url)
  self.prefix = "/pulpcore_registry/"
  self.site = "#{uri.scheme}://#{uri.host}:#{uri.port}"
  pulp_primary.pulp3_ssl_configuration(self, :net_http)

  self
end

.loggerObject



44
45
46
# File 'app/lib/katello/resources/registry.rb', line 44

def logger
  ::Foreman::Logging.logger('katello/registry_proxy')
end

.process_response(response) ⇒ Object



62
63
64
65
66
# File 'app/lib/katello/resources/registry.rb', line 62

def process_response(response)
  debug_level = response.code >= 400 ? :error : :debug
  logger.send(debug_level, "Registry request returned with code #{response.code}")
  super
end