Media types

Media types are created to specify the delivery method for reports. These media types are unique to each company and are built upon three primary base types: Email, SCP, and Kafka.

Mediatypes can be managed by navigating to Administration > Mediatypes. It displays a list with all configured media types and let’s you create new ones.

mediaTypesList
Media types list

Create a media type

To create a new media type click the blue plus:

mediatypeForm
Create a media type form

  • Name: Specify the name of the media type.
  • Company: Select the company in which the media type will be available.
  • Base type: Choose from the three available base types: Email, SCP, or Kafka.

After providing the necessary details, click Create. The newly created media type will be added to the list of media types.

Media type configuration

You can access its configuration by clicking the card.

Email configuration

In the case of delivering reports via Email, you will need to provide the following information:

mediatypeEmailConf
Media type: Email configuration form

  • Company: The company for which the media type is created. This cannot be changed.
  • Mediatype: Base type, which is Email. This also cannot be changed.
  • Name: Specify a name for this media type.
  • Sender email address: Enter the email address used to send emails.
  • Email server address: Provide the FQDN or IP address of the mail server.
  • Email server Port: Typically, this is either 25 or 587, depending on your mail server’s configuration.
  • Email server authentication: Enable this option if authentication is required to connect to the mail server.
  • Email server Username: Enter the username to use for mail server authentication.
  • Email server Password: Provide the password for mail server authentication.
  • Email Subject: Include any static text you want in the email header.
  • Email Body: Add any static text you want in the email body.

SCP configuration

When reports are delivered via SCP to a remote server, SSH access to the target server is required. This method also allows you to execute a script or command after the delivery is complete.

mediatypeSCPConf
Media type: SCP configuration form

  • Company: The company for which the media type is created. This setting cannot be changed.
  • Mediatype: Base type, which is SCP. You cannot change this setting.
  • Name: Specify a name for this media type.
  • Host: Enter the FQDN or IP address of the remote server.
  • Port: Typically, the port for SSH access is 22.
  • Username: Provide the username to use for SSH access to the remote server.
  • SSH-Key: Include the public key of the given user for authentication.
  • Run script after delivery: Specify whether you want to run the command given by the script after the report delivery is complete.
  • Script: If you choose to run a script, enter the script or command to execute.

Kafka configuration

When reports are sent to a Kafka server:

mediatypeKafkaConf
Media type: Kafka configuration form

  • Company: The company for which the media type is created. This setting cannot be changed.
  • Mediatype: Base type, which is Kafka. You cannot change this setting.
  • Name: Provide a name for this media type.
  • Kafka server address: Enter the address of the Kafka broker you want to connect to. This should be the FQDN or IP address of the Kafka broker.
  • Kafka server port: Typically, the port for the Kafka broker connection is 9092.
  • Partition: Specify the partition on the Kafka broker to which the reports should be sent.
  • Kafka topic: Indicate the topic on the Kafka broker where the reports should be sent.
  • Application Name: You can include an application name to be embedded in the message sent to the Kafka broker.
  • Enable Authentication: Choose whether to use authentication based on certificates.
  • Client Certificate: If you enable authentication, provide the client certificate in PEM format.
  • Private Key: This is the private key associated with the client certificate and should also be in PEM format.
  • CA Certificate: Include the CA certificate in PEM format.
  • Skip certificate validation: Decide whether to verify the Kafka server’s certificate.

Kafka message structure used by DataForge for report delivery

type Message struct {
    ApplicationName     string `json:"applicationName"` // name of the application sending the message
    Type                string `json:"type"` // type of this message (in this case 'report')
    ContentType         string `json:"contentType"` // MIME-Type of the enclosed report
    ContentEncoding     string `json:"contentEncoding"` // Encoding of the enclosed report
    Version             string `json:"version"` // format version (currently 1.0)
    Hash                string `json:"hash"` // hash of the enclosed data
    Data                string `json:"data"` // the actual report in json
}

Delete media type

Open the context menu and click delete.