Table Of Contents

Module - jobs.job_subscriptions

JobSubscriptions

Configuration for a subscription job.

type

object

properties

  • subscriptions

Defines input sources for the subscriptions and subscriptions_status tables.

Subscriptions

allOf

SubscriptionsSection

  • tableau

Default configurations for Tableau exports.

Tableau

allOf

Tableau

  • mail

Defines how email is sent.

Mail

allOf

EmailConfig

definitions

  • RelativeDates

RelativeDates

Define names used when converting date_range in subscriptions.json_data to a value filter.

A subscription’s json_data column may contain a name/value pair of the form: “date_range”: “YESTERDAY”, which specifies a relative date with which to filter data. By default, this will be converted, e.g., into two Vizql view filters similar to these:

"global_start_datetime": "2020-07-15 00:00:00.000000"
"global_end_datetime": "2020-07-15 23:59:59.999999"
>>> from datetime import datetime
>>> mon = datetime(2020, 9, 14, 12, 23, 49, 456789)
>>> tue = datetime(2020, 9, 15, 12, 23, 49, 987654)
>>> config = {"start_datetime": "begin", "end_datetime": "end"}
>>> rd = RelativeDates(**config)
>>> rd.as_view_filter(mon, tue)
{'begin': '2020-09-14 12:23:49.456789', 'end': '2020-09-15 12:23:49.987654'}
>>> config["datetime_format"] = "%Y-%m-%d %H:%M:%S.%F"
>>> rd=RelativeDates(**config)
>>> rd.as_view_filter(mon, tue)
{'begin': '2020-09-14 12:23:49.456', 'end': '2020-09-15 12:23:49.987'}
>>> mon = datetime(2020, 9, 14, 12, 23, 49, 0)
>>> rd.as_view_filter(mon, tue)
{'begin': '2020-09-14 12:23:49.000', 'end': '2020-09-15 12:23:49.987'}
>>> config["datetime_format"] = "%Y/%m/%d"
>>> rd=RelativeDates(**config)
>>> rd.as_view_filter(mon, tue)
{'begin': '2020/09/14', 'end': '2020/09/15'}

type

object

properties

  • start_datetime

Start Datetime

View filter name to use when specifying the beginning of a datetime range.

type

string

examples

earliest_datetime

default

global_start_datetime

  • end_datetime

End Datetime

View filter name to use when specifying the end of a datetime range.

type

string

examples

latest_datetime

default

global_end_datetime

  • datetime_format

Datetime Format

Python datetime.strftime() format string to use when formatting start_datetime and end_datetime. The format string supports the non-standard format code of %F, which similar to %f except that it is milliseconds instead of microseconds (three digits instead of six). %F can only be used at the end of datetime_format value.

Reference: https://strftime.org

type

string

examples

%Y-%m-%d

%H:%M:%S

%Y-%m-%d %H:%M:%S.%F

default

%Y-%m-%d %H:%M:%S.%f

  • InputSection

InputSection

Defines source/destination for data.

type

object

properties

  • dbo

Dbo

The dbo specifying the database to use.

Example: "postgresql://localhost/mitto"

type

string

  • 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

  • relative_dates

Customization of relative dates (date_range in json_data).

Relative Dates

default

OrderedDict([(‘start_datetime’, ‘global_start_datetime’), (‘end_datetime’, ‘global_end_datetime’), (‘datetime_format’, ‘%Y-%m-%d %H:%M:%S.%f’)])

allOf

RelativeDates

  • SubscriptionsSection

SubscriptionsSection

Configuration for a subscription job.

type

object

properties

  • subscriptions_input

Defines the location of the subscriptions table. This table is created and managed by the Portal.

Subscriptions Input

allOf

InputSection

  • subscription_status_input

Defines the location of the subscriptions_status table. The table is created and managed by this job.

Subscription Status Input

allOf

InputSection

  • TableauCredentials

TableauCredentials

Tableau server credentials.

type

object

properties

  • username

Username

Tableau username.

type

string

examples

steve

  • password

Password

Tableau password.

type

string

examples

steve-password

additionalProperties

False

  • TableauServer

TableauServer

Tableau server configuration.

type

object

properties

  • server

Server

Tableau server to use.

type

string

examples

https://tableau.zuar.com

  • site

Site

Tableau site to use. Note: to use the "Default" site, provide a empty string value (i.e., a value of "").

type

string

examples

  • user_id_to_impersonate

User Id To Impersonate

Tableau username to impersonate when authenticating. If not provided, no impersonation is performed.

type

string

examples

3908c4ce-b171-46f3-b12b-d8827c162199

additionalProperties

False

  • CSVExport

CSVExport

Complete definition of the Tableau REST CSV export

type

object

properties

  • name

Name

Name that the export will be saved under. Do not include the extension; it will be determined automatically.

type

string

default

tableau-export

  • workbook

Workbook

_content_url of the workbook

type

string

  • view

View

_content_url of the view

type

string

  • view_filters

View Filters

View filters to apply to data.

type

object

examples

OrderedDict([(‘State’, [‘Louisiana’, ‘Texas’]), (‘Category’, [‘Office Supplies’])])

OrderedDict([(‘region’, [‘LATAM’, ‘NA’]), (‘sub_region’, []), (‘plant_name’, []), (‘global_start_datetime’, ‘2020-06-12 00:00:00.000’), (‘global_end_datetime’, ‘2020-06-12 23:59:59.999’)])

default

OrderedDict()

  • full

Full

Process all views in workbook, not just the view specified by view.

type

boolean

examples

true

false

null

  • timeout

Timeout

Maximum number of seconds to allow before killing request.

type

integer

default

300

  • retries

Retries

Maximum number of times to retry a failed request.

type

integer

default

5

  • maxage

Maxage

The maximum number of minutes the CSV data will be cached on the server before being refreshed. The value must be an integer between 1 and 240 minutes. 0 will be interpreted as 1 minute on server, as that is the shortest interval allowed.

type

integer

maximum

240

minimum

-1

default

-1

  • type

Type

Type of export being performed.

type

string

examples

csv

default

csv

additionalProperties

False

  • PDFLayoutOptions

PDFLayoutOptions

Defines all available Vizql page layout options

type

object

properties

  • imageHeight

Imageheight

type

string

examples

1440

1024

pattern

^d+$

default

0

  • imageWidth

Imagewidth

type

string

examples

3440

1280

pattern

^d+$

default

0

  • pageFitHorizontal

Pagefithorizontal

type

string

examples

1

2

pattern

^[12]$

default

1

  • pageFitVertical

Pagefitvertical

type

string

examples

1

2

pattern

^[12]$

default

1

  • pageOrientationOption

Pageorientationoption

type

string

examples

landscape

portrait

default

landscape

  • pageScaleMode

Pagescalemode

type

string

examples

auto

fit-pages

percent

default

auto

  • pageScalePercent

Pagescalepercent

type

string

examples

25

50

60

75

80

90

100

200

400

default

100

  • pageSizeOption

Pagesizeoption

type

string

examples

a3

a4

a5

b4

b5

executive

folio

ledger

legal

letter

note

quarto

statement

tabloid

unspecified

default

letter

additionalProperties

False

  • PDFModifications

PDFModifications

Modification to make to a Vizql PDF Export request.

type

object

properties

  • request

Request

The request to modify.

type

string

examples

auth

embed

bootstrap

export_options

export_server

  • action

Action

The type of modification to perform to the request.

replace – Replace the contents of the request with items.

update – Update the contents of the request with items. Contents not matching items remain in the request unchanged.

pop – Any keys in the request matching keys in items are removed from the request. Values associated with keys in items are ignored.

type

string

examples

update

replace

pop

default

update

  • destination

Destination

The argument to modify in the requests operation that will be performed.

type

string

examples

data

cookies

files

headers

params

  • items

Items

Keys and values to use in modifying the request.

type

object

examples

OrderedDict([(‘clientDimension’, “{‘w’: 1280, ‘h’: 1024}”), (‘dashboardPortSize’, “{‘w’: 1280, ‘h’: 1024}”), (‘worksheetPortSize’, “{‘w’: 1280, ‘h’: 1024}”)])

additionalProperties

type

string

additionalProperties

False

  • PDFExport

PDFExport

Complete definition of the Tableau Vizql PDF export

type

object

properties

  • name

Name

Name that the export will be saved under. Do not include the extension; it will be determined automatically.

type

string

default

tableau-export

  • workbook

Workbook

_content_url of the workbook

type

string

  • view

View

_content_url of the view

type

string

  • view_filters

View Filters

View filters to apply to data.

type

object

examples

OrderedDict([(‘State’, [‘Louisiana’, ‘Texas’]), (‘Category’, [‘Office Supplies’])])

OrderedDict([(‘region’, [‘LATAM’, ‘NA’]), (‘sub_region’, []), (‘plant_name’, []), (‘global_start_datetime’, ‘2020-06-12 00:00:00.000’), (‘global_end_datetime’, ‘2020-06-12 23:59:59.999’)])

default

OrderedDict()

  • full

Full

Process all views in workbook, not just the view specified by view.

type

boolean

examples

true

false

null

  • timeout

Timeout

Maximum number of seconds to allow before killing request.

type

integer

default

300

  • retries

Retries

Maximum number of times to retry a failed request.

type

integer

default

5

  • maxage

Maxage

The maximum number of minutes the CSV data will be cached on the server before being refreshed. The value must be an integer between 1 and 240 minutes. 0 will be interpreted as 1 minute on server, as that is the shortest interval allowed.

type

integer

maximum

240

minimum

-1

default

-1

  • type

Type

Type of export being performed.

type

string

examples

pdf

default

pdf

  • options

Options

default

OrderedDict([(‘imageHeight’, ‘0’), (‘imageWidth’, ‘0’), (‘pageFitHorizontal’, ‘1’), (‘pageFitVertical’, ‘1’), (‘pageOrientationOption’, ‘landscape’), (‘pageScaleMode’, ‘auto’), (‘pageScalePercent’, ‘100’), (‘pageSizeOption’, ‘letter’)])

allOf

PDFLayoutOptions

  • modifications

Modifications

type

array

default

[]

items

PDFModifications

  • log_requests

Log Requests

Log the content of each request.

type

boolean

examples

true

false

default

False

  • log_responses

Log Responses

Log the content of each response received from the server. Helpful for determining what data is available for use in requests.

type

boolean

examples

true

false

default

False

  • save_responses

Save Responses

Save the content of each response received from the server in /tmp. Helpful for determining what data is available for use in requests.

type

boolean

examples

true

false

default

False

additionalProperties

False

  • XLSXExport

XLSXExport

Complete definition of the Tableau REST XLSX export

type

object

properties

  • name

Name

Name that the export will be saved under. Do not include the extension; it will be determined automatically.

type

string

default

tableau-export

  • workbook

Workbook

_content_url of the workbook

type

string

  • view

View

_content_url of the view

type

string

  • view_filters

View Filters

View filters to apply to data.

type

object

examples

OrderedDict([(‘State’, [‘Louisiana’, ‘Texas’]), (‘Category’, [‘Office Supplies’])])

OrderedDict([(‘region’, [‘LATAM’, ‘NA’]), (‘sub_region’, []), (‘plant_name’, []), (‘global_start_datetime’, ‘2020-06-12 00:00:00.000’), (‘global_end_datetime’, ‘2020-06-12 23:59:59.999’)])

default

OrderedDict()

  • full

Full

Process all views in workbook, not just the view specified by view.

type

boolean

examples

true

false

null

  • timeout

Timeout

Maximum number of seconds to allow before killing request.

type

integer

default

300

  • retries

Retries

Maximum number of times to retry a failed request.

type

integer

default

5

  • maxage

Maxage

The maximum number of minutes the CSV data will be cached on the server before being refreshed. The value must be an integer between 1 and 240 minutes. 0 will be interpreted as 1 minute on server, as that is the shortest interval allowed.

type

integer

maximum

240

minimum

-1

default

-1

  • type

Type

Type of export being performed.

type

string

examples

xlsx

default

xlsx

additionalProperties

False

  • Tableau

Tableau

Defaults to use for Tableau Vizql and REST exports.

type

object

properties

  • credentials

Tableau server credentials. Credentials may be explicitly included in the job’s configuration as a dict. If the value is a string, it is assumed to be the name of named credentials to use.

Credentials

anyOf

type

string

allOf

TableauCredentials

  • server

Tableau server configuration.

Server

allOf

TableauServer

  • export_csv

Defaults for CSV exports via REST API.

Export Csv

default

OrderedDict([(‘name’, ‘tableau-export’), (‘workbook’, None), (‘view’, None), (‘view_filters’, OrderedDict()), (‘full’, None), (‘timeout’, 300), (‘retries’, 5), (‘maxage’, -1), (‘type’, ‘csv’)])

allOf

CSVExport

  • export_pdf

Defaults for PDF exports via Vizql API.

Export Pdf

default

OrderedDict([(‘name’, ‘tableau-export’), (‘workbook’, None), (‘view’, None), (‘view_filters’, OrderedDict()), (‘full’, None), (‘timeout’, 300), (‘retries’, 5), (‘maxage’, -1), (‘type’, ‘pdf’), (‘options’, OrderedDict([(‘imageHeight’, ‘0’), (‘imageWidth’, ‘0’), (‘pageFitHorizontal’, ‘1’), (‘pageFitVertical’, ‘1’), (‘pageOrientationOption’, ‘landscape’), (‘pageScaleMode’, ‘auto’), (‘pageScalePercent’, ‘100’), (‘pageSizeOption’, ‘letter’)])), (‘modifications’, []), (‘log_requests’, False), (‘log_responses’, False), (‘save_responses’, False)])

allOf

PDFExport

  • export_xlsx

Defaults for XLSX exports via REST API.

Export Xlsx

default

OrderedDict([(‘name’, ‘tableau-export’), (‘workbook’, None), (‘view’, None), (‘view_filters’, OrderedDict()), (‘full’, None), (‘timeout’, 300), (‘retries’, 5), (‘maxage’, -1), (‘type’, ‘xlsx’)])

allOf

XLSXExport

  • export

For internal use only.

Export

anyOf

allOf

CSVExport

allOf

PDFExport

allOf

XLSXExport

  • destination_dir

Destination Dir

Directory in which the exported report will be saved.

type

string

default

/home/khe/mitto-2.8.x/data

format

directory-path

additionalProperties

False

  • EmailConfig

EmailConfig

EmailConfig controls how email and attachments are sent.

It is used to optionally override settings contained in a subscription. It is subclassed from the base email config, job_email.JobConfig, so that mail_to can be made Optional. If this classes mail_to has a value of `None, then no override takes place and the value from the subscription is used.

type

object

properties

  • server

Server

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

type

string

default

localhost

  • 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 name or dict containing username and password.

Credentials

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.

type

string

default

default_mail_subject

  • mail_from

Mail From

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

Example::

steve@zuar.com

type

string

  • mail_to

Mail To

anyOf

type

string

type

array

items

type

string

  • mail_cc

CC recipients.

Mail Cc

anyOf

type

string

type

array

items

type

string

  • mail_bcc

BCC recipients.

Mail Bcc

anyOf

type

string

type

array

items

type

string

  • text

Text

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

type

string

  • html

Html

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

Example:

“<html><head>CEO Report</head><body>Job done.</body></html>”

type

string

  • attachments

Attachments

List of attachments file names under mitto data directory or paths.

Example:

[“vehicles.csv”, “/tmp/temp_data.txt”]

type

array

items

type

string