Class: KatelloApi::Resources::Repository

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

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

.docObject



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

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

Instance Method Details

#create(params = {}, headers = {}) ⇒ Array

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):

  • product_id (String)

    product the repository belongs to

  • content_type (String)

    type of repo (either ‘yum’ or ‘puppet’, defaults to ‘yum’)

  • enabled (String)

    flag that enables/disables the repository

  • gpg_key_name (String)

    name of a gpg key that will be assigned to the new repository

  • label (String)
  • name (String)
  • url (String)

    repository source url

Returns:

  • (Array)

    First item: parsed data; second item: raw body



41
42
43
# File 'lib/katello_api/resources/repository.rb', line 41

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

#destroy(params = {}, headers = {}) ⇒ Array

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)

Returns:

  • (Array)

    First item: parsed data; second item: raw body



69
70
71
# File 'lib/katello_api/resources/repository.rb', line 69

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

#index(params = {}, headers = {}) ⇒ Array

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):

  • environment_id (String)

    id of an environment to show repositories in

  • organization_id (String)

    id of an organization to show repositories in

  • product_id (String)

    id of a product to show repositories of

  • enabled (String)

    limit to only enabled repositories

  • full_results (String)

    whether or not to show all results

  • library (String)

    show repositories in library and the default content view

  • 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



26
27
28
# File 'lib/katello_api/resources/repository.rb', line 26

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

#show(params = {}, headers = {}) ⇒ Array

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)

    repository id

Returns:

  • (Array)

    First item: parsed data; second item: raw body



50
51
52
# File 'lib/katello_api/resources/repository.rb', line 50

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

#sync(params = {}, headers = {}) ⇒ Array

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)

    repository id

Returns:

  • (Array)

    First item: parsed data; second item: raw body



78
79
80
# File 'lib/katello_api/resources/repository.rb', line 78

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

#update(params = {}, headers = {}) ⇒ Array

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)

    repository id

  • gpg_key_id (String)

    id of a gpg key that will be assigned to this repository

Returns:

  • (Array)

    First item: parsed data; second item: raw body



60
61
62
# File 'lib/katello_api/resources/repository.rb', line 60

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