Sha256: 0c8a5263ab29b7c895b2ec7810d367611fdb7f53ba295570ff391dcb718aef1b

Contents?: true

Size: 936 Bytes

Versions: 191

Compression:

Stored size: 936 Bytes

Contents

module Katello
  module Resources
    module Candlepin
      class Subscription < CandlepinResource
        class << self
          def destroy(subscription_id)
            fail ArgumentError, "subscription id has to be specified" unless subscription_id
            self.delete(path(subscription_id), self.default_headers).code.to_i
          end

          def get(id = nil)
            content_json = super(path(id), self.default_headers).body
            JSON.parse(content_json)
          end

          def get_for_owner(owner_key, included = [])
            content_json = Candlepin::CandlepinResource.get(
              "/candlepin/owners/#{owner_key}/subscriptions?#{included_list(included)}",
              self.default_headers
            ).body
            JSON.parse(content_json)
          end

          def path(id = nil)
            "/candlepin/subscriptions/#{id}"
          end
        end
      end
    end
  end
end

Version data entries

191 entries across 191 versions & 1 rubygems

Version Path
katello-4.4.0.2 app/lib/katello/resources/candlepin/subscription.rb
katello-4.4.0.1 app/lib/katello/resources/candlepin/subscription.rb
katello-4.3.1 app/lib/katello/resources/candlepin/subscription.rb
katello-4.4.0 app/lib/katello/resources/candlepin/subscription.rb
katello-4.4.0.rc2 app/lib/katello/resources/candlepin/subscription.rb
katello-4.4.0.rc1 app/lib/katello/resources/candlepin/subscription.rb
katello-4.2.2 app/lib/katello/resources/candlepin/subscription.rb
katello-4.3.0 app/lib/katello/resources/candlepin/subscription.rb
katello-4.3.0.rc4 app/lib/katello/resources/candlepin/subscription.rb
katello-4.3.0.rc3 app/lib/katello/resources/candlepin/subscription.rb
katello-4.3.0.rc2.1 app/lib/katello/resources/candlepin/subscription.rb
katello-4.3.0.rc2 app/lib/katello/resources/candlepin/subscription.rb
katello-4.3.0.rc1 app/lib/katello/resources/candlepin/subscription.rb
katello-4.2.1 app/lib/katello/resources/candlepin/subscription.rb
katello-4.2.0.1 app/lib/katello/resources/candlepin/subscription.rb
katello-4.1.4 app/lib/katello/resources/candlepin/subscription.rb
katello-4.0.3 app/lib/katello/resources/candlepin/subscription.rb
katello-4.2.0.1.rc3 app/lib/katello/resources/candlepin/subscription.rb
katello-3.18.5 app/lib/katello/resources/candlepin/subscription.rb
katello-4.2.0.1.rc2 app/lib/katello/resources/candlepin/subscription.rb