Skip to main content

Client for uploading and managing Functions in CIM Database Cloud.

Project description

CONTACT Logo Functions-Client

This CLI tool is used for uploading and managing Functions in CIM Database Cloud.

Installation

$ pip install contactsoftware-functions-client

Login

Before you can create environments or deploy Functions you need to login using your client-id and secret. Obtain your client credentials via the CONTACT Portal.

$ cfc login --client-id <client_id> --client-secret <client_secret>

Usage

First you need to have an environment that you can deploy your code into.

Check if you already have environments available:

$ cfc env list

or create a new one:

$ cfc env create <environment_name>

You need to create an environment.yaml file that lists the Functions your environment should contain:

runtime: python3.10
version: v1
functions:
  - name: my_function
    entrypoint: main.my_function

and of course the code of your Function:

# main.py
def my_function(metadata, event, service):
  ...

[!NOTE] You can specify extra requirements your code has in a requirements.txt.

[!IMPORTANT] The python3.10 runtime requires you to add contactsoftware-functions to the requirements.txt unless you specify your own main_entrypoint handler. (see documentation)

Now you can deploy your code into an environment:

$ cfc env deploy <environment_name>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contactsoftware_functions_client-0.4.2.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page