This documentation describes an old release, version 2024.10.10. Documentation for the latest release, 2024.12.2, can be found here.

Class Index: subscriptions_ng.jobs.job_subscriptions_ng.JobConfig

InputSection

Defines source/destination for data.

type

object

properties

  • dbo

Dbo

The dbo specifying the database to use.

Example: "postgresql://localhost/mitto"

type

string

  • credentials

Credentials

Credentials name for the specified database dbo.

type

string

examples

“postgres_credentials”

  • schema_name

Schema Name

The name of the schema.

Example: "public"

type

string

  • table_name

Table Name

The name of the table.

Example: "subscriptions_status"

type

string

Subscriptions

Configuration for tables used by Subscriptions.

type

object

properties

  • subscriptions_input

Subscriptions Input

Defines the location of the subscriptions table. This table is created and managed by the Portal. It must already exist before the subscription job can run. This table is only read by subscriptions – it is never updated.

allOf

InputSection

  • subscription_status_input

Subscription Status Input

Defines the location of the subscriptions_status table. The table is created and managed by this job. It contains the current status of all subscriptions in the subscriptions table.

allOf

InputSection

  • update_status

Update Status

If False, do not update the subuscription_status table when the subscriptions job runs. This is intended for use in testing jobs; the default of True should always be used in production.

type

boolean

default

True

  • current_datetime

Current Datetime

If unset, the current time of the job run is used when determining which subscriptions to run and in updating the subscription_status table. If a value is provided, the datetime value provided is used for this purpose instead of the current time. This is intended for use in testing jobs; it should never be set in production.

A string value must be in the following format: YYYY-MM-DD[T]HH:MM[:SS[.ffffff]][Z or [±]HH[:]MM]. If an int or a float value are provided, they will be treated as a Unix timestamp (seconds since the Epoch).

type

string

examples

2024-01-01

2023-01-12 11:42:31-05:00

2023-01-12T11:42:31Z

1726090830

format

date-time

  • perform_export

Perform Export

If True (the default), the associated export job is run and the email is sent with the file as an attachment. If False, the export is not performed and mail is sent without an attachment. This is intended for use in testing jobs; the default value should generally be used in production.

type

boolean

default

True

  • id_regex

Id Regex

Optional regex. Only subscription ids matching the regex will be processed; others will be skipped. This is intended for use in testing jobs and should not be used in production.

type

string

Export

type

object

properties

  • source_url

Source Url

Base URL of Portal. Does not include dashboard path.

type

string

examples

https://portal-automation.zuarbase.net

  • source_user_id

Source User Id

user_id for source_url

type

string

default

  • source_credentials

Source Credentials

Credentials for source_url. For Zuar Portal, this is the API_KEY

type

string

examples

61zGltB1XIZxiIlMSZuTjSlZuzpb4t6AOMk1OHVgyUU

  • file_path

File Path

Path to file, including file name, in which export will be saved.

type

string

examples

CEO-dashboard.pdf

/var/mitto/data/portal_exports/CEO-dashboard.pdf

  • timeout

Timeout

Maximum time, in seconds, to wait for an export to complete.

type

integer

default

120

  • job_type

Job Type

Runner Job type used to perform the export. Used by Runner

Subscriptions Job to determine how to perform the export. This must be a valid Runner job type. Only required when running an export from job_subscriptions.py. Ignored / can be omitted when running an export via portal_export.py or job_portal_export.py.

type

string

examples

portal_export

  • job_config_path

Job Config Path

Absolute path to a default job configuration file to be used

when running the job type specified in job_type. This default value will be modified by job_subscriptions.py via params passed in to job_portal_export.py.

type

string

EmailConfig

EmailConfig controls how email and attachments are sent.

Certain fields, noted below, undergo template expansion using the dict from the subscription’s json_data column. If a string value contains a substring of the form {key}, then {key} is replaced with json_data["key"].

For example, if:

json_data = {..., "substrate_name": ["Fiber"], ...}

and:

mail_subject = "Report for substrate(s): {substrate_name}"

the subject in the outgoing email will be:

Report for substrate(s): Fiber

type

object

properties

  • server

Server

Hostname or IP address of a server. Defaults to a local postfix.

type

string

default

mail

  • port

Port

The TCP/IP port to use for SMTP. See comment at require_tls.

type

integer

default

25

  • require_tls

Require Tls

Use STARTTLS to establish secure transport. Note that this requires use of a non-TLS port to first establish communication. Often, this means that port should be set to 25 or 2525. Do not use the standard SMTP TLS port (e.g., 465).

type

boolean

default

False

  • credentials

Credentials

Credentials name or dict containing username and password.

examples

‘support_email_account’

{‘username’: ‘<username>’, ‘password’: ‘<password>’}

anyOf

type

string

type

object

additionalProperties

type

string

  • timeout

Timeout

Timeout in seconds for blocking operations.

type

integer

default

30

  • mail_subject

Mail Subject

The Subject of the outgoing email.

Supports optional json_data template expansion.

type

string

examples

Sample report attached

Report for substrate(s): {substrate_name}

default

default_mail_subject

  • mail_from

Mail From

The email address that will appear in the From: field of the outgoing email.

type

string

examples

steve@zuar.com

  • mail_to

Mail To

Used to optionally override settings contained in a subscription.

examples

steve@zuar.com

null

anyOf

type

string

type

array

items

type

string

  • mail_cc

Mail Cc

CC recipients.

anyOf

type

string

type

array

items

type

string

  • mail_bcc

Mail Bcc

BCC recipients.

anyOf

type

string

type

array

items

type

string

  • text

Text

Text template which will be used as the body of the email.

Supports optional json_data template expansion.

type

string

examples

This mail contains the CEO Report

Report for these shifts: {shift_description}

  • html

Html

HTML template which will be used as the body of the email. Although the examples show use of <html> tags, plain test, if present, will be treated as HTML.

Supports optional json_data template expansion.

type

string

examples

<html><head>This mail contains the CEO Report</head></html>

<html><head>Report for these shifts: {shift_description}</head></html>

  • attachments

Attachments

List of a) file names located in MITTO_DATA or b) fully-qualified paths to files that will be attched to the email.

type

array

examples

vehicles.csv

/tmp/temp_data.txt

items

type

string

additionalProperties

False