Metadata-Version: 2.4
Name: contactsoftware-functions-client
Version: 0.5.5
Summary: Client for uploading and managing Functions in CIM Database Cloud.
License: MIT
License-File: LICENSE
Author: Jens Kürten
Author-email: jku@contact.de
Requires-Python: >=3.10,<4
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: PyYAML (>=6.0)
Requires-Dist: appdirs (>=1.4.4)
Requires-Dist: click (>=8.0.4,<8.2.0)
Requires-Dist: requests (>=2.20.0,<3.0.0)
Requires-Dist: rich (>=12.0.1)
Requires-Dist: typer (>=0.15.3)
Requires-Dist: urllib3 (>=1.26.16)
Description-Content-Type: text/markdown

  <h1><a href="https://github.com/cslab/functions-client"><img src="https://github.com/cslab/functions-client/blob/main/docs/assets/contact-logo.svg" width="50" alt="CONTACT Logo"></a>  Functions-Client</h1>

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

Information on how build Functions can be found in the Functions-SDK documentation: https://cslab.github.io/functions-sdk-python/

## Requirements

Python 3.10+

## Installation

```console
$ 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.

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

The credentials will be stored in a configuration file. The storage location of the configuration file depends on the OS:

- Windows: `C:\Users\<username>\AppData\Local\Contact\cfc\config.ini`
- Linux: `~/.config/cfc/config.ini`

> [!WARNING]
> If you are developing a function, you may want to talk to a non-default function-controller.
> You can set the URL via `cfc login --service-url https://my-function-controller.domain` or within the configuration file.

## Features
### Manage Function environments
Functions are grouped into **environments**, which are the (Docker) container the code runs in. An environment contains a runtime for its specific programming language, the Function code and a configuration file describing the environment.

Create a new environment:

```console
$ cfc env create <environment_name>
```

Display a list of all environments:

```console
$ cfc env list
```

Display the details of an environment:

```console
$ cfc env describe <environment_name>
```


### Deploy Function code into an environment
To deploy Function code into an existing environment run:

```
$ cfc env deploy <environment_name>
```

Make sure you run the command from within the directory that contains the `environment.yaml` configuration file.

Information on how to build Function code can be found in the documentation of the Functions-SDK: https://cslab.github.io/functions-sdk-python/

