Package occi :: Module workflow
[hide private]
[frames] | no frames]

Module workflow

source code

Python module holding routines for handling resources and collections.

Created on Jun 30, 2011


Author: tmetsch

Functions [hide private]
 
create_entity(key, entity, registry, extras)
Handles all the model magic during creation of an entity.
source code
 
delete_entity(entity, registry, extras)
Handles all the model magic during deletion if an entity.
source code
 
replace_entity(old, new, registry, extras)
Replace an entity - backends decide what is done.
source code
 
update_entity(old, new, registry, extras)
Update an entity - backends decide what is done.
source code
 
retrieve_entity(entity, registry, extras)
Retrieves/refreshed an entity.
source code
 
action_entity(entity, action, registry, attributes, extras)
Performs an action on the entity.
source code
 
update_collection(mixin, old_entities, new_entities, registry, extras)
Updates a Collection of Mixin.
source code
 
replace_collection(mixin, old_entities, new_entities, registry, extras)
Replaces a Collection of Mixin.
source code
 
delete_from_collection(mixin, entities, registry, extras)
Removes entities from a collection by removing the mixin from their list.
source code
 
get_entities_under_path(path, registry, extras)
Return all entities which fall under a path.
source code
 
filter_entities(entities, categories, attributes)
Filters a set of entities and return those who match the given categories and attributes.
source code
 
filter_categories(categories, registry, extras)
Filter the categories.
source code
 
append_mixins(mixins, registry, extras)
Add a mixin to the service.
source code
 
remove_mixins(mixins, registry, extras)
Remove a mixin from the service.
source code
 
create_id(kind)
Create a key with the hierarchy of the entity encapsulated.
source code
 
intersect(list_a, list_b)
Returns the intersection of two lists.
source code
 
unique(list_a, list_b)
Returns a list of elements which are only in list_a.
source code
Variables [hide private]
  __package__ = 'occi'

Imports: UserDefinedMixinBackend, Resource, Link, Mixin, HTTPError, uuid


Function Details [hide private]

create_entity(key, entity, registry, extras)

source code 

Handles all the model magic during creation of an entity.

If it's an resource it will verify that all links are created.

If it's a link it will ensure that source and target are properly set.

key -- The key for the entity. entity -- The entity itself - either Link or Resource instance. registry -- The registry used for this process. extras -- Any extra arguments which are defined by the user.

delete_entity(entity, registry, extras)

source code 

Handles all the model magic during deletion if an entity.

If it's a link it will remove the link from the entity source links list.

entity -- The entity itself - either Link or Resource instance. registry -- The registry used for this process. extras -- Any extra arguments which are defined by the user.

replace_entity(old, new, registry, extras)

source code 

Replace an entity - backends decide what is done.

If it's a link the entities must be replaced.

old -- The old entity. new -- The new entity. registry -- The registry used for this process. extras -- Any extra arguments which are defined by the user.

update_entity(old, new, registry, extras)

source code 

Update an entity - backends decide what is done.

If it's a link the entities must be updated.

old -- The old entity. new -- The new entity. registry -- The registry used for this process. extras -- Any extra arguments which are defined by the user.

retrieve_entity(entity, registry, extras)

source code 

Retrieves/refreshed an entity.

If it's a link the entities must be retrieved/refreshed.

entity -- The entity which is to be retrieved. registry -- The registry used for this process. extras -- Any extra arguments which are defined by the user.

action_entity(entity, action, registry, attributes, extras)

source code 

Performs an action on the entity.

entity -- The entity on which to perform the operation. action -- The action definition. registry -- The registry used for this process. attributes -- The attributes fro the operation. extras -- Any extra arguments which are defined by the user.

update_collection(mixin, old_entities, new_entities, registry, extras)

source code 

Updates a Collection of Mixin. If not present in the current collections entities will be added to the collection (aka. assigned the Mixin).

mixin -- The mixin which defines the collection. old_entities -- The entities which are in the collection to date. new_entities -- The entities which should be added to the collection. registry -- The registry used for this process. extras -- Any extra arguments which are defined by the user.

replace_collection(mixin, old_entities, new_entities, registry, extras)

source code 

Replaces a Collection of Mixin. If not present in the current collections entities will be added to the collection (aka. assigned the Mixin). If old entities are not present in the new collection the mixin will be removed from them.

mixin -- The mixin which defines the collection. old_entities -- The entities which are in the collection to date. new_entities -- The new collection of entities. registry -- The registry used for this process. extras -- Any extra arguments which are defined by the user.

delete_from_collection(mixin, entities, registry, extras)

source code 

Removes entities from a collection by removing the mixin from their list.

mixin -- The mixin which defines the collection. entities -- The entities which are to be removed. registry -- The registry used for this process. extras -- Any extra arguments which are defined by the user.

get_entities_under_path(path, registry, extras)

source code 

Return all entities which fall under a path.

If the path is in locations return all entities of the kind which defines the location.

If the path is just a path return all children.

path -- The path under which to look... registry -- The registry used for this process. extras -- Any extra arguments which are defined by the user.

filter_entities(entities, categories, attributes)

source code 

Filters a set of entities and return those who match the given categories and attributes.

entities -- The entities which are to be filtered. categories -- Categories which must be present in the entity. attributes -- Attributes which must match with the entity's attrs.

filter_categories(categories, registry, extras)

source code 

Filter the categories. Only those requested should be added to the resulting list.

categories -- The list of categories to filter against. registry -- The registry used for this process. extras -- Passed on extra object.

append_mixins(mixins, registry, extras)

source code 

Add a mixin to the service.

mixins -- The mixins which are to be added. registry -- The registry used for this process. extras -- Passed on extra object.

remove_mixins(mixins, registry, extras)

source code 

Remove a mixin from the service.

mixins -- The mixin which are to be removed. registry -- The registry used for this process. extras -- Any extra arguments which are defined by the user.

create_id(kind)

source code 

Create a key with the hierarchy of the entity encapsulated.

kind -- The kind which this id should be created for.

intersect(list_a, list_b)

source code 

Returns the intersection of two lists.

list_a -- The first list. list_b -- Another list.

unique(list_a, list_b)

source code 

Returns a list of elements which are only in list_a.

list_a -- The list to look into for unique elements. list_b -- Ths list the verify against.