Create Workflow

Once the REST HTTP service is up and running, it can be called with the following cURL command:

curl -X 'POST' \
  'http://${API_SERVICE_URL}:${API_SERVICE_PORT}/api/v1/workflow-run' \
  -H 'Content-Type: multipart/form-data' \
  -F 'runWorkflowRequest={
    "input_connection": {
      "jdbc_url": "jdbc:${SOURCE_DRIVER_PREFIX}://${SOURCE_URL}:${SOURCE_PORT}",
      "user": {
        "type": "raw",
        "value": "${SOURCE_USERNAME}"
      },
      "password": {
        "type": "raw",
        "value": "${SOURCE_PASSWORD}"
      }
    },
    "output_connection": {
      "jdbc_url": "jdbc:${DESTINATION_DRIVER_PREFIX}://${DESTINATION_URL}:${DESTINATION_PORT}",
      "user": {
        "type": "raw",
        "value": "${DESTINATION_USERNAME}"
      },
      "password": {
        "type": "raw",
        "value": "${DESTINATION_PASSWORD}"
      }
    },
    "workflow_id": 0,
    "workflow_name": "string"
  };type=application/json' \
-F 'config=@${TRANSFORMATION_CONFIG_FILE_PATH}'

Where:

  • input_connection is the configuration of the database to which testing-suite connects. The database configuration has the following parameters:

    • jdbc_url (required): JDBC url of the source database, e.g. jdbc:postgresql://39.176.0.1:5432/.

    • user: Username to access the database. Please see Database Credentials to know more about supported formats.

    • password: Username’s password to access the database. Please see Database Credentials to know more about supported formats.

  • output_connection is the configuration of the database where testing-suite writes the synthesized data. The same parameters as input_connection are used here, but for the target database.

  • in config, transformation parameters can be added here as described in Configuration File.

  • workflow_id is ID of the workflow, needed to track history of workflow runs

  • workflow_name is workflow display name

Note

The config parameter in cURL expects a YAML formatted string, which contains connection parameters specified above and Configuration File. For ease of use, it is recommended to store all these configuration parameters into a config.yaml file, and then the cURL command can be simplified to:

curl -X 'POST' \
  'http://localhost:8081/api/v1/workflow-run' \
  -H 'Content-Type: multipart/form-data' \
  -F 'runWorkflowRequest={
      "input_connection": {
        "jdbc_url": "string",
        "user": {
          "type": "raw",
          "value": "string"
        },
        "password": {
          "type": "raw",
          "value": "string"
        }
      },
      "output_connection": {
        "jdbc_url": "string",
        "user": {
          "type": "raw",
          "value": "string"
        },
        "password": {
          "type": "raw",
          "value": "string"
        }
      },
      "workflow_id": 0,
      "workflow_name": "string"
    };type=application/json' \
  -F 'config=@config.yaml'

Where config.yaml is a file like:

default_config:
  mode: "GENERATION"
Note

It is important to specify content type application/json for the JSON part of the request.