SDK for python serverless functions
Project description
Serverless cloud functions
Contents
Quick Start
- Install via pip:
pip install sels8s
- Download rc.sh file from Selectel panel
- Set environment variables: -OS_USERNAME - your username in panel -OS_PASSWORD - your password -OS_PROJECT_ID - your project id -OS_PROJECT_DOMAIN_NAME - your project domain name -OS_USER_DOMAIN_NAME - your user domain name
- Create your own cloud function:
import sels8s serverless = sels8s.Serverless() # upload file module = serverless.upload_module('/home/my_file.py') # create function serverless.create_function('my_function') # add your code and params module_id = module.json()["function_id"] serverless.edit_function('my_function', function_id=module_id, function_name='name_of_function_in_code', module_name='my_file.py', env_vars={'key':'value'}, runtime='python', version='3.7') # invoke your function activation = serverless.invoke_function('my_function') # get logs and results logs = serverless.get_activation_logs(activation['activation_id']) result = serverless.get_activation_result(activation['activation_id'])
Examples
You can see examples of using cloud functions here
Features
Community
For all questions - sls@selectel.ru
Licensing
Serverless is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sels8s-1.0.3.tar.gz
(3.4 kB
view hashes)
Built Distribution
sels8s-1.0.3-py3-none-any.whl
(4.0 kB
view hashes)