Class: KatelloApi::Resources::Product

Inherits:
Base
  • Object
show all
Defined in:
lib/katello_api/resources/product.rb

Constant Summary

Constant Summary

Constants inherited from Base

Base::API_VERSION

Instance Attribute Summary

Attributes inherited from Base

#client, #config

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Base

#http_call, #initialize, method_doc, #perform_call, #validate_params!, validation_hash

Constructor Details

This class inherits a constructor from KatelloApi::Base

Class Method Details

+ (Object) doc



4
5
6
# File 'lib/katello_api/resources/product.rb', line 4

def self.doc
  @doc ||= KatelloApi.doc['resources']["products"]
end

Instance Method Details

- (Array) create(params = {}, headers = {})

Returns First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • gpg_key_id (String)

    identifier of the gpg key

  • organization_id (String)

    id of the organization

  • sync_plan_id (String, nil)

    plan numeric identifier

  • description (String)

    product description

  • label (String)
  • name (String)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



39
40
41
# File 'lib/katello_api/resources/product.rb', line 39

def create(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) destroy(params = {}, headers = {})

Returns First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • id (String)

    product numeric identifier

Returns:

  • (Array)

    First item: parsed data; second item: raw body



71
72
73
# File 'lib/katello_api/resources/product.rb', line 71

def destroy(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) index(params = {}, headers = {})

Returns First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • organization_id (String)

    filter products by organization

  • subscription_id (String)

    filter products by subscription

  • enabled (String)

    filter products by enabled or disabled

  • full_results (String)

    whether or not to show all results

  • name (String)

    filter products by name

  • order (String)

    sort field and order, eg. ‘name desc’

  • page (String)

    page number, starting at 1

  • per_page (String)

    number of results per page to return

  • search (String)

    search string

  • sort (Hash)

    hash version of ‘order’ param allowed keys are:

    • by [String] field to sort the results on

    • order [String] how to order the sorted results (e.g. asc for ascending)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



25
26
27
# File 'lib/katello_api/resources/product.rb', line 25

def index(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) show(params = {}, headers = {})

Returns First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • id (String)

    product numeric identifier

Returns:

  • (Array)

    First item: parsed data; second item: raw body



48
49
50
# File 'lib/katello_api/resources/product.rb', line 48

def show(params = {}, headers = {})
  perform_call(__method__, params, headers)
end

- (Array) update(params = {}, headers = {})

Returns First item: parsed data; second item: raw body

Parameters:

  • params (Hash) (defaults to: {})

    a hash of params to be passed to the service

  • headers (Hash) (defaults to: {})

    additional http headers

Options Hash (params):

  • id (String)

    product numeric identifier

  • gpg_key_id (String)

    identifier of the gpg key

  • sync_plan_id (String, nil)

    plan numeric identifier

  • description (String)

    product description

  • label (String)
  • name (String)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



62
63
64
# File 'lib/katello_api/resources/product.rb', line 62

def update(params = {}, headers = {})
  perform_call(__method__, params, headers)
end