Python EntityService Documentation

Methods

get_entities

get_entities()

Return a list of all entities

Returns:

A list of dictionaries from Entity objects (:rtype: list of dictionaries)

get_entity

get_entity(id)

Return a dictionary from the Entity object based on id

Arguments:

  • id: Entity id

Returns:

dictionary of Entity object (:rtype: dictionary)

Raises:

  • Exception: id retrieval fails

create_entity

create_entity(entity)

Create a new Entity object

Arguments:

  • entity: dictionary of entity fields

Returns:

dictionary of Entity object (:rtype: dictionary)

Raises:

  • Exception: if entity fields are invalid

update_entity

update_entity(id, entity)

Update existing entity

Arguments:

  • entity: dictionary of entity fields
  • id: Entity id

Returns:

dictionary of Entity object (:rtype: dictionary)

delete_entity

delete_entity(id)

Delete existing entity

Arguments:

  • id: Entity id

Returns:

id of the Entity deleted (:rtype: integer)