Skip to Content
APIs and IntegrationModule Specification

Module Specification

This section describes the specifications a webservice has to implement so it can be used as a module for Cinnamon.

Concept of External Processing Servers

As already described in the Architecture section, the processing is done in external processing modules. Generally, there are two types of modules:

  1. Modules, that transform data and return a new or modified dataset. Cinnamon Anonymization and Cinnamon Synthetization are of this type.
  2. Modules, that analyse the data and return statistics. Cinnamon Evaluation and Cinnamon Risk-Assessment are of this type.

These modules can be swapped with own implementations if they fulfill some requirements.

Required API Endpoints for External Processing Servers

Webservices that want to function as external processing modules have to provide 5 API endpoints for the following tasks:

In order to allow, details about these endpoints, like the URL path of, can be configured, see Configuration for more details. Cinnamon Platform provides one endpoint for receiving the results in a callback request.

Provide Available Algorithms

Description:

Provides a list of algorithms available in the module.

Specification:

URLHTTP MethodRequest TypeResponse Type
ConfigurableGETNoneYAML

Response Content:

Must return an array of available algorithms. An algorithm has the following attributes:

ParameterTypeDescription
DescriptionstringDescription of the algorithm shown in the algorithm selection.
display_namestringName displayed in the UI.
namestringInternal identifier.
typestringType of data the algorithm supports. Currently not used as the platform only supports cross sectional data.
URLstringPath after the server URL for fetching the configuration definition of the algorithm.
versionstringVersion of the algorithm.

Response Example:

algorithms: - description: CTGAN is a GAN-based model that can generate synthetic tabular data. display_name: Conditional Tabular GAN name: ctgan type: cross-sectional URL: /synthetic_tabular_data_generator/synthesizer_config/ctgan.yaml version: `0.1`

Provide Configuration Definitions

Description:

Provides the configuration definition for a specific algorithm.

Specification:

URLHTTP MethodRequest TypeResponse Type
Provided by the algorithm endpointGETNoneYAML

Response Content:

The root element has same fields as a single algorithm in the algorithm definition and additionally the fields of a configuration group.

Configuration Group

ParameterTypeDescription
display_namestringDisplay name of the group.
descriptionstringDescription of the group.
parametersInput Definition[]Configuration parameter in this group.
configurationsRecord of ConfigurationGroupNested configuration groups. Displayed inside a collapsable.
optionsRecord of ConfigurationGroupNested configuration groups that can be toggled. Displayed inside a collapsable.

Input Definition

ParameterTypeDescription
namestringName for identifying the parameter in the configuration.
typeInput TypeType of the parameter and the input.
labelstringLabel displayed in the UI.
descriptionstringDescription displayed in the UI.
default_valueDepending on the type: string or number or number[]The default value for the input.
invertstring or nullIf type is attribute_list and the value is not null, a list of unchecked attributes named as the value of this parameter will be added to the configuration.
min_valuenumberMinimum value if type is float or integer.
max_valuenumberMaximum value if type is float or integer.
valuesstring[] or nullIf type is float or string, turns the input into a select input.
switchSwitch[]Optional, overwrites definitions based on values of other parameters.

Input Type

NameDescriptionInput Element
attributeSelection of one attribute inside the dataset.One select input.
attribute_listSelection of multiple attributes inside the dataset.One checkbox per attribute
booleanTrue of false.One checkbox.
floatNumeric number.One numerical input.
integerNatural number.One numerical input.
listList of number with dynamic size.Multiple numerical inputs.
stringFreetext or selectionOne text input.

Switch

NameTypeDescription
depends_onstringname of the depending configuration parameter.
conditionsCondition[]List of conditions and their changes.

Condition

NameTypeDescription
ifstringValue of the depending parameter.
valuesstringOptional, overwrites values in Input Definition
min_valuenumberOptional, min_value in Input Definition
max_valuenumberOptional, max_value in Input Definition

Response Example:

name: ctgan version: "0.1" type: cross-sectional display_name: Conditional Tabular GAN description: Is a GAN for synthesizing cross-sectional data. URL: /start_synthetization_process/ctgan configurations: model_parameter: display_name: Model Parameters description: Define the model parameters, that are used for training the model. parameters: - name: generator_dim type: list label: Generator Dimensions description: Refers to the sizes of the intermediate layers in the generator network of a generative model. default_value: [256, 256, 256] - name: generator_lr type: float label: Generator Learning Rate description: The learning rate used for updating the parameters of the generator network in CTGAN. default_value: 0.004 min_value: 0.000000001 max_value: 1.0 - name: batch_size type: integer label: Batch Size description: Number of training samples processed before the model's internal parameters are updated. default_value: 500 min_value: 1 max_value: 1024 - name: log_frequency type: boolean label: Log Frequency description: Whether to use log frequency of categorical levels in conditional sampling. default_value: True sampling: display_name: Sampling description: Define the sampling parameters, that are used for generating the synthetic data. parameters: - name: num_samples type: integer label: Samples description: Configure the Samples. default_value: 1000 min_value: 1 max_value: 1000000

The resulting configuration could look like this:

synthetization_configuration: algorithm: synthesizer: ctgan type: cross-sectional version: \"0.1\" model_parameter: generator_dim: - 256 - 256 - 256 generator_lr: 0.004 batch_size: 50 log_frequency: true sampling: num_samples: 100

Start Processes

Description:

Starts a specified algorithm

Specification:

URLHTTP MethodRequest TypeResponse Type
ConfigurablePOSTmultipart/form-dataJSON

Request Content:

PartDescription
dataThe dataset selected in Cinnamon’s configuration. Data and data configuration can be send in one part as JSON or as two separate parts as CSV and YAML. Name of the part/parts can be configured.
configurationThe algorithm configuration. Name of the part can be configured.
callbackURL for the result callback. Name of the part can be configured.
session_keyThe process ID in the platform.

Response Content:

The response can have the following properties, other properties are ignored:

ParameterTypeDescription
errorstringError message.
messagestringNormal message.
pidstringThe process ID for identifying the process on the external server. Can be empty if the ID of the platform is used.

Monitor Process Status

Description:

Fetches the status of the specified process.

Specification:

URLHTTP MethodRequest TypeResponse Type
Configurable (session_key injectable)GETNoneText

Response Content: Content is interpreted and displayed as plain text.

Cancel Processes

Description:

Cancels the specified process.

Specification:

URLHTTP MethodRequest TypeResponse Type
Configurable (session_key injectable)Configurablemultipart/form-dataNone

Request Content:

ParameterTypeDescription
pidstringThe process ID returned when starting a process. Null if nothing was returned.
session_keystringThe process ID in the platform.

Sending Results to Cinnamon Platform

Description:

Accepts the results of a process.

Specification:

URLHTTP MethodRequest TypeResponse Type
/api/process/<session_key>/callback (Sent when starting the process)POSTmultipart/form-dataNone

Request Content:

The results of a process are defined in the Platform Configuration. They can contain data as CSV or JSON, statistics or an error message.

Last updated on