Mathieu Bacou
mathieu.bacou@telecom-sudparis.eu
Télécom SudParis, IMT, IP Paris, Inria
2026–2027 CSC5004 — Cloud Computing Infrastructures
from platform_api import KeyValueStore
def main(args, env):
"""Entrypoint to the cloud function
:param args: dictionary (JSON) of arguments passed in the request
:param env: dictionary (JSON) of environment variables
"""
name, place = args['name'], args['place']
# Totally fictitious example of using a key-value store from BaaS.
with KeyValueStore(env['TOKEN']) as cnx:
age = cnx.get('age', {'id': name})
msg = f'Hello {name} from {place}!'
# Return a result (a dictionary, translated to JSON).
return {
'greetings': msg,
}