Add README section describing content of the environment dictionnary (#6339)

This commit is contained in:
Benjamin Dauvergne 2015-01-23 17:39:45 +01:00
parent 05fe3f3650
commit 8757d554c7
1 changed files with 45 additions and 0 deletions

45
README
View File

@ -61,6 +61,50 @@ being deployed. Successfully deployed services will add a link to their
administration pages on the homepage.
Environment
-----------
An Hobo agent is a class defined in `hobo.agent.services` and derived from
`BaseService`. For each service in the environment dictionary sent by the hobo
portal, it's instantiated with the key `base_url`, `title` and `secret_key` of
the service. If the `base_url` matches the `AGENT_HOST_PATTERNS` locally
defined, the `execute()` method of the instant is called, passing it the full
environment dictionary.
The environment dictionary contains services for this particular agent and all
other services defined on the portal. The `execute()` method should only create
a tenant for the service whose `base_url` was passed to constructor. All other
informations are only for defining links with other services. The schema of the
dictionary is::
{
'timestamp': <current_time_as_an_unix_timestamp>,
'users': [
{
'username': 'john.doe',
'first_name': 'John',
'last_name': 'Doe',
'email': 'john.doe@example.com',
'password': '<django-compatible-hashed-password>',
}
},
'services': [
{
'service-id': 'authentic' / 'wcs' / 'passerelle',
'title': 'name of service,
'secret_key': '..', # base secret for Django applications or other needs
'base_url': 'base url of the service',
'template_name': 'demo', # name of the template bundle to use
'variables': {
'variable-1': 'value-of-variable-1'
}
}
]
'variables': {
'variable-1': 'value-of-variable-1'
}
}
Agents
------
@ -74,3 +118,4 @@ to use sudo if necessary).
Template keys defined in SERVICE_TEMPLATES have to map wcs skeleton sites
(created from settings / export) stored in /var/lib/wcs/skeletons (the exact
directory may vary according to the wcs configuration).