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 import time ex = True while ex: try: activation = serverless.invoke_function('my_function') ex = False except Exception: time.sleep(10) # get logs and results while ex: try: logs = serverless.get_activation_logs(activation.json()['activation_id']) result = serverless.get_activation_result(activation.json()['activation_id']) ex = False except Exception: time.sleep(10)
Examples
You can see examples of using cloud functions here
Features
Community
For all questions - Our Telegram
Licensing
Serverless is licensed under the Apache 2.0.
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.7.tar.gz
(4.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sels8s-1.0.7.tar.gz.
File metadata
- Download URL: sels8s-1.0.7.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28adeb3156efbe1a5d181a91db730cee46e471011b4df464b25577e36080ba39
|
|
| MD5 |
16da97aa07b95aaf5cd8ebf87109988e
|
|
| BLAKE2b-256 |
dc65f111a6fa07f6532e85aab54e6551e9f28dba6a1c4d383548d74ec0ee1ccd
|
File details
Details for the file sels8s-1.0.7-py3-none-any.whl.
File metadata
- Download URL: sels8s-1.0.7-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
567c8f3e5c9eded0d06b4f341d9274eee76dcbd802465d428ddff7fad255468f
|
|
| MD5 |
7625df507ab389ed77f08f06d67e313c
|
|
| BLAKE2b-256 |
e4f593120c3c8f56adda077d3ccb05e325e6ede9b3a2062dd9d92c549ce6dcb4
|