Package pulp :: Package server :: Package api :: Module repo :: Class RepoApi
[hide private]
[frames] | no frames]

Class RepoApi

source code

  object --+    
           |    
base.BaseApi --+
               |
              RepoApi

API for create/delete/syncing of Repo objects

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_indexes(self) source code
 
_unique_indexes(self) source code
 
_getcollection(self) source code
 
_validate_schedule(self, sync_schedule)
Verifies the sync schedule is in the correct cron syntax, throwing an exception if it is not.
source code
 
_get_existing_repo(self, id)
Protected helper function to look up a repository by id and raise a PulpException if it is not found.
source code
 
create(self, id, name, arch, feed=None, symlinks=False, sync_schedule=None, cert_data=None, productid=None)
Create a new Repository object and return it
source code
 
_write_certs_to_disk(self, repoid, cert_data) source code
 
create_product_repo(self, content_set, cert_data, productid)
Creates a repo associated to a product.
source code
 
get_repos_by_product(self, productid)
Lookup available repos associated to a product id
source code
 
delete(self, id)
Delete a single stored Object
source code
 
update(self, repo_data)
Write the object document to the database
source code
 
repositories(self, spec=None, fields=None)
Return a list of Repositories
source code
 
repository(self, id, fields=None)
Return a single Repository object
source code
 
packages(self, id, name=None)
Return list of Package objects in this Repo
source code
 
get_package(self, id, name)
Return matching Package object in this Repo
source code
 
add_package(self, repoid, packageid)
Adds the passed in package to this repo
source code
 
_add_package(self, repo, p)
Responsible for properly associating a Package to a Repo
source code
 
remove_package(self, repoid, p) source code
 
errata(self, id, types=())
Look up all applicable errata for a given repo id
source code
 
add_erratum(self, repoid, erratumid)
Adds in erratum to this repo
source code
 
add_errata(self, repoid, errataids=())
Adds a list of errata to this repo
source code
 
_add_erratum(self, repo, erratumid)
Responsible for properly associating an Erratum to a Repo
source code
 
delete_erratum(self, repoid, erratumid)
delete erratum from this repo
source code
 
delete_errata(self, repoid, errataids)
delete list of errata from this repo
source code
 
_delete_erratum(self, repo, erratumid)
Responsible for properly removing an Erratum from a Repo
source code
 
create_packagegroup(self, repoid, group_id, group_name, description)
Creates a new packagegroup saved in the referenced repo
source code
 
delete_packagegroup(self, repoid, groupid)
Remove a packagegroup from a repo
source code
 
update_packagegroup(self, repoid, pg)
Save the passed in PackageGroup to this repo
source code
 
update_packagegroups(self, repoid, pglist)
Save the list of passed in PackageGroup objects to this repo
source code
 
packagegroups(self, id)
Return list of PackageGroup objects in this Repo
source code
 
packagegroup(self, repoid, groupid)
Return a PackageGroup from this Repo
source code
 
add_packages_to_group(self, repoid, groupid, pkg_names=[], gtype="default") source code
 
delete_package_from_group(self, repoid, groupid, pkg_name, gtype="default") source code
 
create_packagegroupcategory(self, repoid, cat_id, cat_name, description)
Creates a new packagegroupcategory saved in the referenced repo
source code
 
delete_packagegroupcategory(self, repoid, categoryid)
Remove a packagegroupcategory from a repo
source code
 
update_packagegroupcategory(self, repoid, pgc)
Save the passed in PackageGroupCategory to this repo
source code
 
update_packagegroupcategories(self, repoid, pgclist)
Save the list of passed in PackageGroupCategory objects to this repo
source code
 
packagegroupcategories(self, id)
Return list of PackageGroupCategory objects in this Repo
source code
 
packagegroupcategory(self, repoid, categoryid)
Return a PackageGroupCategory object from this Repo
source code
 
_update_groups_metadata(self, repoid)
Updates the groups metadata (example: comps.xml) for a given repo
source code
 
sync(self, id, progress_callback=None)
Sync a repo from the URL contained in the feed
source code
 
upload(self, id, pkginfo, pkgstream)
Store the uploaded package and associate to this repo
source code
dict
all_schedules(self)
For all repositories, returns a mapping of repository name to sync schedule.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

    Inherited from base.BaseApi
 
clean(self)
Delete all the Objects in the database.
source code
 
insert(self, object, check_keys=False)
Insert the object document to the database
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

_indexes(self)

source code 
Decorators:
  • @property
Overrides: base.BaseApi._indexes

_unique_indexes(self)

source code 
Decorators:
  • @property
Overrides: base.BaseApi._unique_indexes

_getcollection(self)

source code 
Overrides: base.BaseApi._getcollection

create(self, id, name, arch, feed=None, symlinks=False, sync_schedule=None, cert_data=None, productid=None)

source code 

Create a new Repository object and return it

Decorators:
  • @event(subject= 'repo.created')
  • @audit(params= ['id', 'name', 'arch', 'feed'])

create_product_repo(self, content_set, cert_data, productid)

source code 

Creates a repo associated to a product. Usually through an event raised from candlepin

Parameters:
  • productid (str) - A product the candidate repo should be associated with.
  • content_set (dict(<label> : <relative_url>,)) - a dict of content set labels and relative urls
  • cert_data (dict(ca : <ca_cert>, cert: <ent_cert>, key : <cert_key>)) - a dictionary of ca_cert, cert and key for this product
Decorators:
  • @audit(params= ['productid', 'content_set'])

get_repos_by_product(self, productid)

source code 

Lookup available repos associated to a product id

Parameters:
  • productid (str) - productid a candidate repo is associated.
Decorators:
  • @audit()

delete(self, id)

source code 

Delete a single stored Object

Decorators:
  • @audit()
Overrides: base.BaseApi.delete
(inherited documentation)

update(self, repo_data)

source code 

Write the object document to the database

Decorators:
  • @audit()
Overrides: base.BaseApi.update
(inherited documentation)

add_package(self, repoid, packageid)

source code 

Adds the passed in package to this repo

Decorators:
  • @audit()

remove_package(self, repoid, p)

source code 
Decorators:
  • @audit()

add_erratum(self, repoid, erratumid)

source code 

Adds in erratum to this repo

Decorators:
  • @audit()

delete_erratum(self, repoid, erratumid)

source code 

delete erratum from this repo

Decorators:
  • @audit()

create_packagegroup(self, repoid, group_id, group_name, description)

source code 

Creates a new packagegroup saved in the referenced repo

Parameters:
  • repoid
  • group_id
  • group_name
  • description - @return packagegroup object
Decorators:
  • @audit(params= ['repoid', 'group_id', 'group_name'])

delete_packagegroup(self, repoid, groupid)

source code 

Remove a packagegroup from a repo

Parameters:
  • repoid - repo id
  • groupid - package group id
Decorators:
  • @audit()

update_packagegroup(self, repoid, pg)

source code 

Save the passed in PackageGroup to this repo

Parameters:
  • repoid - repo id
  • pg - packagegroup
Decorators:
  • @audit()

update_packagegroups(self, repoid, pglist)

source code 

Save the list of passed in PackageGroup objects to this repo

Parameters:
  • repoid - repo id
  • pglist - list of packagegroups
Decorators:
  • @audit()

packagegroups(self, id)

source code 

Return list of PackageGroup objects in this Repo

Parameters:
  • id - repo id
Returns:
packagegroup or None

packagegroup(self, repoid, groupid)

source code 

Return a PackageGroup from this Repo

Parameters:
  • repoid - repo id
  • groupid - packagegroup id
Returns:
packagegroup or None

add_packages_to_group(self, repoid, groupid, pkg_names=[], gtype="default")

source code 
Parameters:
  • repoid - repository id
  • groupid - group id
  • pkg_names - package names
  • gtype - OPTIONAL type of package group, example "mandatory", "default", "optional"
Decorators:
  • @audit()

delete_package_from_group(self, repoid, groupid, pkg_name, gtype="default")

source code 
Parameters:
  • repoid - repository id
  • groupid - group id
  • pkg_name - package name
  • gtype - OPTIONAL type of package group, example "mandatory", "default", "optional"
Decorators:
  • @audit()

create_packagegroupcategory(self, repoid, cat_id, cat_name, description)

source code 

Creates a new packagegroupcategory saved in the referenced repo

Parameters:
  • repoid
  • cat_id
  • cat_name
  • description - @return packagegroupcategory object
Decorators:
  • @audit(params= ['repoid', 'cat_id', 'cat_name'])

delete_packagegroupcategory(self, repoid, categoryid)

source code 

Remove a packagegroupcategory from a repo

Decorators:
  • @audit()

update_packagegroupcategory(self, repoid, pgc)

source code 

Save the passed in PackageGroupCategory to this repo

Decorators:
  • @audit()

update_packagegroupcategories(self, repoid, pgclist)

source code 

Save the list of passed in PackageGroupCategory objects to this repo

Decorators:
  • @audit()

_update_groups_metadata(self, repoid)

source code 

Updates the groups metadata (example: comps.xml) for a given repo

Parameters:
  • repoid - repo id
Returns:
True if metadata was successfully updated, otherwise False

sync(self, id, progress_callback=None)

source code 

Sync a repo from the URL contained in the feed

Decorators:
  • @audit()

upload(self, id, pkginfo, pkgstream)

source code 

Store the uploaded package and associate to this repo

Decorators:
  • @audit(params= ['id', 'pkginfo'])

all_schedules(self)

source code 

For all repositories, returns a mapping of repository name to sync schedule.

Returns: dict
key - repo name, value - sync schedule