Skip to main content

Serverless cloud functions

Contents

  1. Quick Start
  2. Examples
  3. Features
  4. Community
  5. Licensing

Quick Start

  1. Install via pip:
    pip install sels8s
    
  2. Download rc.sh file from Selectel panel
  3. 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
  4. 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

Cloud functions

Docs

Community

GitHub

For all questions - Our Telegram

Licensing

Serverless is licensed under the Apache 2.0.

Release files for sels8s 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sels8s 1.0.7
File Size Uploaded
sels8s-1.0.7.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sels8s 1.0.7
File Interpreter ABI Platform
sels8s-1.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 8.2 kB

Release files / sels8s-1.0.7.tar.gz

Download URL sels8s-1.0.7.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
28adeb3156efbe1a5d181a91db730cee46e471011b4df464b25577e36080ba39
BLAKE2b-256 checksum
How to use checksums
dc65f111a6fa07f6532e85aab54e6551e9f28dba6a1c4d383548d74ec0ee1ccd
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / sels8s-1.0.7-py3-none-any.whl

Download URL sels8s-1.0.7-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
567c8f3e5c9eded0d06b4f341d9274eee76dcbd802465d428ddff7fad255468f
BLAKE2b-256 checksum
How to use checksums
e4f593120c3c8f56adda077d3ccb05e325e6ede9b3a2062dd9d92c549ce6dcb4
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.0.7 This release

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page