Package pulp :: Package server :: Package api :: Module consumer_history :: Class ConsumerHistoryApi
[hide private]
[frames] | no frames]

Class ConsumerHistoryApi

source code

  object --+    
           |    
base.BaseApi --+
               |
              ConsumerHistoryApi

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_getcollection(self) source code
?
_get_consumer_collection(self)
The circular dependency of requiring the consumer API causes issues, so when looking up a consumer as a validation check we go directly to the consumer collection.
source code
list of pulp.server.db.model.ConsumerHistoryEvent instances
query(self, consumer_id=None, event_type=None, limit=None, sort='descending', start_date=None, end_date=None)
Queries the consumer history storage.
source code
 
event_types(self) source code
 
consumer_created(self, consumer_id, originator=ORIGINATOR_CONSUMER)
Creates a new event to represent a consumer being created.
source code
 
consumer_deleted(self, consumer_id, originator=ORIGINATOR_CONSUMER)
Creates a new event to represent a consumer being deleted.
source code
 
repo_bound(self, consumer_id, repo_id, originator=ORIGINATOR_CONSUMER)
Creates a new event to represent a consumer binding to a repo.
source code
 
repo_unbound(self, consumer_id, repo_id, originator=ORIGINATOR_CONSUMER)
Creates a new event to represent removing a binding from a repo.
source code
 
packages_installed(self, consumer_id, package_nveras, originator=ORIGINATOR_CONSUMER)
Creates a new event to represent packages that were installed on a consumer.
source code
 
packages_removed(self, consumer_id, package_nveras, originator=ORIGINATOR_CONSUMER)
Creates a new event to represent packages that were removed from a consumer.
source code

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

    Inherited from base.BaseApi
 
_indexes(self) source code
 
_unique_indexes(self) source code
 
clean(self)
Delete all the Objects in the database.
source code
 
delete(self, **kwargs)
Delete a single stored Object
source code
 
insert(self, object, check_keys=False)
Insert the object document to the database
source code
 
update(self, object)
Write 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)

_getcollection(self)

source code 
Overrides: base.BaseApi._getcollection

_get_consumer_collection(self)

source code 

The circular dependency of requiring the consumer API causes issues, so when looking up a consumer as a validation check we go directly to the consumer collection. This method returns a hook to that collection.

Returns: ?
pymongo database connection to the consumer connection

query(self, consumer_id=None, event_type=None, limit=None, sort='descending', start_date=None, end_date=None)

source code 

Queries the consumer history storage.

Parameters:
  • consumer_id (string or number) - if specified, events will only be returned for the the consumer referenced; an error is raised if there is no consumer for the given ID
  • event_type (string (enumeration found in TYPES)) - if specified, only events of the given type are returned; an error is raised if the event type mentioned is not listed in the results of the event_types call
  • limit (number greater than zero) - if specified, the query will only return up to this amount of entries; default is to not limit the entries returned
  • sort (string; valid values are 'ascending' and 'descending') - indicates the sort direction of the results; results are sorted by timestamp
  • start_date (datetime.datetime) - if specified, no events prior to this date will be returned
  • end_date (datetime.datetime) - if specified, no events after this date will be returned
Returns: list of pulp.server.db.model.ConsumerHistoryEvent instances
list of consumer history entries that match the given parameters; empty list (not None) if no matching entries are found
Raises:

consumer_created(self, consumer_id, originator=ORIGINATOR_CONSUMER)

source code 

Creates a new event to represent a consumer being created.

Parameters:
  • consumer_id (string or number) - identifies the newly created consumer
  • originator (string) - if specified, should be the username of the admin who created the consumer through the admin API; defaults to indicate the create was triggered by the consumer itself

consumer_deleted(self, consumer_id, originator=ORIGINATOR_CONSUMER)

source code 

Creates a new event to represent a consumer being deleted.

Parameters:
  • consumer_id (string or number) - identifies the deleted consumer
  • originator (string) - if specified, should be the username of the admin who deleted the consumer through the admin API; defaults to indicate the create was triggered by the consumer itself

repo_bound(self, consumer_id, repo_id, originator=ORIGINATOR_CONSUMER)

source code 

Creates a new event to represent a consumer binding to a repo.

Parameters:
  • consumer_id (string or number) - identifies the consumer being modified
  • repo_id (string or number) - identifies the repo being bound to the consumer
  • originator (string) - if specified, should be the username of the admin who bound the repo through the admin API; defaults to indicate the create was triggered by the consumer itself

repo_unbound(self, consumer_id, repo_id, originator=ORIGINATOR_CONSUMER)

source code 

Creates a new event to represent removing a binding from a repo.

Parameters:
  • consumer_id (string or number) - identifies the consumer being modified
  • repo_id (string or number) - identifies the repo being unbound from the consumer
  • originator (string) - if specified, should be the username of the admin who unbound the repo through the admin API; defaults to indicate the create was triggered by the consumer itself

packages_installed(self, consumer_id, package_nveras, originator=ORIGINATOR_CONSUMER)

source code 

Creates a new event to represent packages that were installed on a consumer.

Parameters:
  • consumer_id (string or number) - identifies the consumer being modified
  • package_nveras (list or string; a single string will automatically be wrapped in a list) - identifies the packages that were installed on the consumer
  • originator (string) - if specified, should be the username of the admin who installed packages through the admin API; defaults to indicate the create was triggered by the consumer itself

packages_removed(self, consumer_id, package_nveras, originator=ORIGINATOR_CONSUMER)

source code 

Creates a new event to represent packages that were removed from a consumer.

Parameters:
  • consumer_id (string or number) - identifies the consumer being modified
  • package_nveras (list or string; a single string will automatically be wrapped in a list) - identifies the packages that were removed from the consumer
  • originator (string) - if specified, should be the username of the admin who removed packages through the admin API; defaults to indicate the create was triggered by the consumer itself