Sha256: fabb396b701cc96591c9df4c98f06416c27ccfdd7f2e1e0a3568c0a2a3d656c2

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 KB

Contents

require 'pulp_certguard_client'

module Katello
  module Pulp3
    module Api
      class ContentGuard < Core
        def self.client_module
          PulpCertguardClient
        end

        def self.api_exception_class
          PulpCertguardClient::ApiError
        end

        def api_client
          api_client_class(PulpCertguardClient::ApiClient.new(smart_proxy.pulp3_configuration(PulpCertguardClient::Configuration)))
        end

        def rhsm_api_client
          PulpCertguardClient::ContentguardsRhsmApi.new(api_client)
        end

        def create(name = "RHSMCertGuard", ca_certificate = Cert::Certs.ca_cert)
          data = PulpCertguardClient::CertguardRHSMCertGuard.new(name: name, ca_certificate: ca_certificate)
          rhsm_api_client.create(data)
        rescue self.class.api_exception_class => e
          raise e unless list&.results&.first
        end

        def list(options = {})
          rhsm_api_client.list options
        end

        def partial_update(href, ca_certificate = Cert::Certs.ca_cert)
          data = PulpCertguardClient::CertguardRHSMCertGuard.new(ca_certificate: ca_certificate)
          rhsm_api_client.partial_update(href, data)
        end

        def delete(href)
          rhsm_api_client.delete(href) if href
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
katello-4.1.0.rc2.2 app/services/katello/pulp3/api/content_guard.rb
katello-4.1.0.rc2.1 app/services/katello/pulp3/api/content_guard.rb
katello-4.1.0.rc2 app/services/katello/pulp3/api/content_guard.rb
katello-4.1.0.rc1.1 app/services/katello/pulp3/api/content_guard.rb
katello-4.1.0.rc1 app/services/katello/pulp3/api/content_guard.rb