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



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

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



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

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

  • 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



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

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



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

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



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

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



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

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