Class Index: jobs.job_subscriptions.JobSubscriptions¶
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 |
|
View filter name to use when specifying the beginning of a datetime range. |
||
type |
string |
|
examples |
earliest_datetime |
|
default |
global_start_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 |
|
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¶
Defines source/destination for data. |
|||
type |
object |
||
properties |
|||
|
Dbo |
||
The Example: |
|||
type |
string |
||
|
Credentials |
||
Credentials name for the specified database |
|||
type |
string |
||
examples |
“postgres_credentials” |
||
|
Schema Name |
||
The name of the schema. Example: |
|||
type |
string |
||
|
Table Name |
||
The name of the table. Example: |
|||
type |
string |
||
|
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 |
SubscriptionsSection¶
Configuration for a subscription job. |
|||
type |
object |
||
properties |
|||
|
Defines the location of the |
||
Subscriptions Input |
|||
allOf |
|||
|
Defines the location of the |
||
Subscription Status Input |
|||
allOf |
TableauCredentials¶
Tableau server credentials. |
||
type |
object |
|
properties |
||
|
Username |
|
Tableau username. |
||
type |
string |
|
examples |
steve |
|
|
Password |
|
Tableau password. |
||
type |
string |
|
examples |
steve-password |
|
additionalProperties |
False |
TableauServer¶
Tableau server configuration. |
||
type |
object |
|
properties |
||
|
Server |
|
Tableau server to use. |
||
type |
string |
|
examples |
||
|
Site |
|
Tableau site to use. Note: to use the |
||
type |
string |
|
examples |
||
|
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¶
Complete definition of the Tableau REST CSV export |
||
type |
object |
|
properties |
||
|
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 |
|
|
||
type |
string |
|
|
View |
|
|
||
type |
string |
|
|
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 |
|
Process all views in workbook, not just the view specified by
|
||
type |
boolean |
|
examples |
true |
|
false |
||
null |
||
|
Timeout |
|
Maximum number of seconds to allow before killing request. |
||
type |
integer |
|
default |
300 |
|
|
Retries |
|
Maximum number of times to retry a failed request. |
||
type |
integer |
|
default |
5 |
|
|
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 of export being performed. |
||
type |
string |
|
examples |
csv |
|
default |
csv |
|
additionalProperties |
False |
PDFLayoutOptions¶
Defines all available Vizql page layout options |
||
type |
object |
|
properties |
||
|
Imageheight |
|
type |
string |
|
examples |
1440 |
|
1024 |
||
pattern |
^d+$ |
|
default |
0 |
|
|
Imagewidth |
|
type |
string |
|
examples |
3440 |
|
1280 |
||
pattern |
^d+$ |
|
default |
0 |
|
|
Pagefithorizontal |
|
type |
string |
|
examples |
1 |
|
2 |
||
pattern |
^[12]$ |
|
default |
1 |
|
|
Pagefitvertical |
|
type |
string |
|
examples |
1 |
|
2 |
||
pattern |
^[12]$ |
|
default |
1 |
|
|
Pageorientationoption |
|
type |
string |
|
examples |
landscape |
|
portrait |
||
default |
landscape |
|
|
Pagescalemode |
|
type |
string |
|
examples |
auto |
|
fit-pages |
||
percent |
||
default |
auto |
|
|
Pagescalepercent |
|
type |
string |
|
examples |
25 |
|
50 |
||
60 |
||
75 |
||
80 |
||
90 |
||
100 |
||
200 |
||
400 |
||
default |
100 |
|
|
Pagesizeoption |
|
type |
string |
|
examples |
a3 |
|
a4 |
||
a5 |
||
b4 |
||
b5 |
||
executive |
||
folio |
||
ledger |
||
legal |
||
letter |
||
note |
||
quarto |
||
statement |
||
tabloid |
||
unspecified |
||
default |
letter |
|
additionalProperties |
False |
PDFModifications¶
Modification to make to a Vizql PDF Export request. |
|||
type |
object |
||
properties |
|||
|
Request |
||
The request to modify. |
|||
type |
string |
||
examples |
auth |
||
embed |
|||
bootstrap |
|||
export_options |
|||
export_server |
|||
|
Action |
||
The type of modification to perform to the request.
|
|||
type |
string |
||
examples |
update |
||
replace |
|||
pop |
|||
default |
update |
||
|
Destination |
||
The argument to modify in the |
|||
type |
string |
||
examples |
data |
||
cookies |
|||
files |
|||
headers |
|||
params |
|||
|
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¶
Complete definition of the Tableau Vizql PDF export |
|||
type |
object |
||
properties |
|||
|
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 |
||
|
|||
type |
string |
||
|
View |
||
|
|||
type |
string |
||
|
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 |
||
Process all views in workbook, not just the view specified by
|
|||
type |
boolean |
||
examples |
true |
||
false |
|||
null |
|||
|
Timeout |
||
Maximum number of seconds to allow before killing request. |
|||
type |
integer |
||
default |
300 |
||
|
Retries |
||
Maximum number of times to retry a failed request. |
|||
type |
integer |
||
default |
5 |
||
|
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 of export being performed. |
|||
type |
string |
||
examples |
|||
default |
|||
|
|||
Options |
|||
default |
OrderedDict([(‘imageHeight’, ‘0’), (‘imageWidth’, ‘0’), (‘pageFitHorizontal’, ‘1’), (‘pageFitVertical’, ‘1’), (‘pageOrientationOption’, ‘landscape’), (‘pageScaleMode’, ‘auto’), (‘pageScalePercent’, ‘100’), (‘pageSizeOption’, ‘letter’)]) |
||
allOf |
|||
|
Modifications |
||
type |
array |
||
default |
[] |
||
items |
|||
|
Log Requests |
||
Log the content of each request. |
|||
type |
boolean |
||
examples |
true |
||
false |
|||
default |
False |
||
|
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 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¶
Complete definition of the Tableau REST XLSX export |
||
type |
object |
|
properties |
||
|
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 |
|
|
||
type |
string |
|
|
View |
|
|
||
type |
string |
|
|
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 |
|
Process all views in workbook, not just the view specified by
|
||
type |
boolean |
|
examples |
true |
|
false |
||
null |
||
|
Timeout |
|
Maximum number of seconds to allow before killing request. |
||
type |
integer |
|
default |
300 |
|
|
Retries |
|
Maximum number of times to retry a failed request. |
||
type |
integer |
|
default |
5 |
|
|
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 of export being performed. |
||
type |
string |
|
examples |
xlsx |
|
default |
xlsx |
|
additionalProperties |
False |
Tableau¶
Defaults to use for Tableau Vizql and REST exports. |
|||||
type |
object |
||||
properties |
|||||
|
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 |
|||||
|
Tableau server configuration. |
||||
Server |
|||||
allOf |
|||||
|
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 |
|||||
|
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 |
|||||
|
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 |
|||||
|
For internal use only. |
||||
Export |
|||||
anyOf |
allOf |
||||
allOf |
|||||
allOf |
|||||
|
Destination Dir |
||||
Directory in which the exported report will be saved. |
|||||
type |
string |
||||
default |
/tmp/mitto-tests/data |
||||
format |
directory-path |
||||
additionalProperties |
False |
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 |
||||
Hostname or IP address of a server. Defaults to a local postfix. |
|||||
type |
string |
||||
default |
localhost |
||||
|
Port |
||||
The TCP/IP port to use for SMTP. See comment at |
|||||
type |
integer |
||||
default |
25 |
||||
|
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 |
|||||
type |
boolean |
||||
default |
False |
||||
|
Credentials name or dict containing |
||||
Credentials |
|||||
examples |
‘support_email_account’ |
||||
{‘username’: ‘<username>’, ‘password’: ‘<password>’} |
|||||
anyOf |
type |
string |
|||
type |
object |
||||
additionalProperties |
type |
string |
|||
|
Timeout |
||||
Timeout in seconds for blocking operations. |
|||||
type |
integer |
||||
default |
30 |
||||
|
Mail Subject |
||||
The |
|||||
type |
string |
||||
default |
default_mail_subject |
||||
|
Mail From |
||||
The email address that will appear in the
|
|||||
type |
string |
||||
|
Mail To |
||||
anyOf |
type |
string |
|||
type |
array |
||||
items |
|||||
type |
string |
||||
|
CC recipients. |
||||
Mail Cc |
|||||
anyOf |
type |
string |
|||
type |
array |
||||
items |
|||||
type |
string |
||||
|
BCC recipients. |
||||
Mail Bcc |
|||||
anyOf |
type |
string |
|||
type |
array |
||||
items |
|||||
type |
string |
||||
|
Text |
||||
Text template which will be used as the body of the email. |
|||||
type |
string |
||||
|
Html |
||||
HTML template which will be used as the body of the email.
|
|||||
type |
string |
||||
|
Attachments |
||||
List of attachments file names under mitto data directory or paths.
|
|||||
type |
array |
||||
items |
|||||
type |
string |