Class - jobs.job_tableau_export.TabcmdExportSection

JSON Schema

TabcmdExportSection

This section of the JSON configuration and its subsections control the operation of job_tableau_export.

type

object

properties

  • tabcmd

Tabcmd

Parameters used with tabcmd when processing each ReportSpecification in report_specifications.

allOf

TabcmdSection

  • smtp

Smtp

Parameters to be used when emailing each ReportSpecification in report_specifications.

To use the postfix present on Mitto systems (in its default configuration), use the following value:

{“server”: “localhost”, “port”: 0, “require_tls”: true},

allOf

SmtpSection

  • report_specifications

Report Specifications

Defines the source of the ReportSpecification used for exporting and emailing reports.

allOf

ReportSpecificationsSection

definitions

  • TabcmdSection

TabcmdSection

Parameters used for each invocation of tabcmd export on each ReportSpecification.

type

object

properties

  • server

Server

Hostname or IP address of Tableau server.

type

string

  • site

Site

Tableau site. To specify the Default site, use a value of “”, not “Default”. This is necessary because the Tableau tabcmd command interprets “” as the Default site.

type

string

  • user

User

Tableau user id.

type

string

  • password

Password

Password for Tableau user.

type

string

  • path

Path

Path to location of tabcmd on Mitto instance.

type

string

default

/opt/tableau/tabcmd/bin/tabcmd

  • timeout

Timeout

Maximum number of seconds to allow tabcmd to run before killing it.

type

integer

default

60

  • retries

Retries

Maximum number of times to retry a failed tabcmd.

type

integer

default

3

  • no_certcheck

No Certcheck

If true, do not check TLS certificate validity of server.

type

boolean

default

True

  • port

Port

TCP/IP port tabcmd should use when contacting server.

type

integer

  • proxy

Proxy

Hostname or IP address of proxy to use when contacting server.

type

string

  • SmtpSection

SmtpSection

Defines the characteristics of the SMTP server that will be used to deliver exported reports.

type

object

properties

  • 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

  • server

Server

Hostname or IP address of server.

type

string

  • username

Username

SMTP user name.

type

string

  • password

Password

Password for SMTP user name.

type

string

  • disabled

Disabled

If True, email is not sent and the contents of this section are ignored. Primarily intended for testing.

type

boolean

default

False

  • ReportSpecificationTypeEnum

ReportSpecificationTypeEnum

Specifies the format and location of the ReportSpecification.

type

string

enum

json, csv, sql

  • ReportTypeEnum

ReportTypeEnum

Specifies the format of the created report.

type

string

enum

pdf, csv, png, fullpdf

  • PagelayoutEnum

PagelayoutEnum

Specifies the page layout.

type

string

enum

landscape, protrait

  • PagesizeEnum

PagesizeEnum

Specifies the page size.

type

string

enum

unspecified, letter, legal, note, folio, tabloid, ledger, statement, executive, a3, a4, a5, b4, b5, quarto

  • ReportSpecification

ReportSpecification

Defines the contents of a single report.

type

object

properties

  • view

View

The Tableau view to use when creating the report. Views may contain spaces.

Example: If the Tableau URL is https://tableau.zuar.com/#/views/Superstore/Overview?:iid=1 then view is "Superstore/Overview".

type

string

  • report_type

The report’s format.

Examples:

"pdf"
"fullpdf"
"csv"
"png"

default

pdf

allOf

ReportTypeEnum

  • refresh

Refresh

type

boolean

default

False

  • height

Height

Height of the report image in pixels. Only valid when report_type is png.

type

integer

  • width

Width

Height of the report image in pixels. Only valid when if report_type is png.

type

integer

  • pagelayout

The page orientation of the report.

Examples:

"landscape"
"portrait"

default

landscape

allOf

PagelayoutEnum

  • pagesize

Assumed paper size to use when creating the report.

Examples:

"letter"
"a4"

default

letter

allOf

PagesizeEnum

  • report_name

Report Name

The name given to the exported report when it is attached to outgoing email. When the recipient saves the attachment, it will be saved using this name. Do not provide an extension (e.g., use "ceo_report" instead of "ceo_report.pdf"; the correct extension will be provided by tabcmd export.

type

string

default

default_report_name

  • mail_subject

Mail Subject

The subject line of the outgoing email.

Example:

"Q4 Results"

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

One or more comma-separated email addresses. The report will be emailed to the address(es).

Example:

"alice@foo.com,bob@foo.com,ted@bar.com"

type

string

  • mail_cc

Mail Cc

CC recipients. Otherwise, same as mail_to.

type

string

  • mail_bcc

Mail Bcc

BCC recipients. Otherwise, same as mail_to.

type

string

  • mail_body

Mail Body

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

Example:

"<html><head>CEO Report</head><body>Report attached.</body></head></html>"

type

string

default

This is the default email body.

  • disabled

Disabled

If True, the report defined by this specification is skipped.

Primarily for use with CSV input from a spreadsheet; it allows individual report specifications to be enabled/disabled without adding/removing rows from the spreadsheet.

type

boolean

default

False

  • ReportSpecificationsSection

ReportSpecificationsSection

Defines a section of the job’s JSON config containing the specifications for one or more reports that are to be exported and emailed.

type

object

properties

  • type

The format used in providing one or more report specifications.

"json": The report specifications will come from the job’s JSON config.

"csv": The report specifications will come from a CSV formatted file.

"sql": The report specifications will come from the results of an SQL query.

allOf

ReportSpecificationTypeEnum

  • source

Source

Provides the detailed specification for each report to be created.

If type is "json", source is a list of ReportSpecification or a valid JSON string representing a list of ReportSpecification.

Example:

"report_specifications": {
    "type": "json",
    "source": [
        {
            "view": "Superstore/Overview",
            "report_name": "report_name01",
            "mail_to": "steve@zuar.com",
            "mail_subject": "Report 01 is ready",
            "mail_from": "bob@zuar.com",
            "parameter_01": "Category",
            "value_01": '"Office Supplies"',
            "parameter_02": "State",
            "value_02": '["Texas", "Louisiana"]',
        },
        {
            "view": "Superstore/Overview",
            "report_name": "report_name02",
            "mail_to": "steve@zuar.com",
            "mail_subject": "Report 02 is ready",
            "mail_from": "bob@zuar.com",
            "parameter_01": "Category",
            "value_01": '["Furniture", "Office Supplies"]',
            "parameter_02": "State",
            "value_02": '"Louisiana"',
        }
    ]
}

If type is "csv", source is a path to a CSV file containing one report specification per row. The first row of the CSV file must be a header with column names corresponding to ReportSpecification attributes.

Example:

"report_specifications": {
    "type": "csv",
    "source": "/var/mitto/data/reports_01-02.csv"
}

Example contents of reports_01-02.csv:

view,report_type,pagelayout,pagesize,report_name,mail_to,mail_subject,mail_from,mail_cc,mail_bcc,parameter_01,value_01,parameter_02,value_02
Superstore/Overview,pdf,landscape,letter,khe_report_name01,khe@east.fm,keh subject 01,ke@east.fm,"kheaustin@gmail.com,kenneth.east@zuar.com",ke@east.fm,Category,""Office Supplies"",State,"[""Texas"", ""Louisiana""]"
Superstore/Overview,fullpdf,landscape,letter,Louisiana Report,"khe@east.fm,KHEAustin@gmail.com",keh subject 02,ke@east.fm,ke@east.fm,"kheaustin@gmail.com,kenneth.east@zuar.com",Category,"[""Furniture"", ""Office Supplies""]",State,""Louisiana""

If type is "sql", source is a SQL query that, when executed, will return one or more ReportSpecification. The SQL query can be either a single string containing the query or a list of strings that are concatenated to create the query.

The dbo attribute must be present when type is "sql".

Example:

"report_specifications": {
    "type": "sql",
    "source": [
        "SELECT",
        "'Superstore/Overview' AS view,",
        "'report_name01' AS report_name,",
        "'steve@zuar.com' AS mail_to,",
        "'Report 01 is ready' AS mail_subject,",
        "'bob@zuar.com' AS mail_from,",
        "'Category' AS parameter_01,",
        "'"Office Supplies"' AS value_01,",
        "'State' AS parameter_02,",
        "'["Texas", "Louisiana"]' AS value_02",
        "UNION ALL",
        "SELECT",
        "'Superstore/Overview' AS view,",
        "'report_name02' AS report_name,",
        "'steve@zuar.com' AS mail_to,",
        "'Report 02 is ready' AS mail_subject,",
        "'bob@zuar.com' AS mail_from,",
        "'Category' AS parameter_01,",
        "'["Furniture", "Office Supplies"]' AS value_01,",
        "'State' AS parameter_02,",
        "'"Louisiana"' AS value_02"
    ],
    "dbo": "postgresql://localhost/analytics"
}

Example:

"report_specifications": {
    "type": "sql",
    "source": "SELECT * FROM report_secification",
    "dbo": "postgresql://localhost/analytics"
}

anyOf

type

array

items

anyOf

ReportSpecification

type

string

type

string

  • dbo

Dbo

The database dbo to use when executing an SQL query to obtain report specificaitons.

Example:

"postgresql://localhost/analytics"

type

string

  • credentials

Credentials

Credentials name for the specified database dbo.

type

string

examples

“postgres_credentials”

  • specifications

Specifications

For internal use only. Results are undefined if a value is provided via the job’s JSON config.

JSON Schema Definitions

#/definitions/TabcmdSection

TabcmdSection

Parameters used for each invocation of tabcmd export on each ReportSpecification.

type

object

properties

  • server

Server

Hostname or IP address of Tableau server.

type

string

  • site

Site

Tableau site. To specify the Default site, use a value of “”, not “Default”. This is necessary because the Tableau tabcmd command interprets “” as the Default site.

type

string

  • user

User

Tableau user id.

type

string

  • password

Password

Password for Tableau user.

type

string

  • path

Path

Path to location of tabcmd on Mitto instance.

type

string

default

/opt/tableau/tabcmd/bin/tabcmd

  • timeout

Timeout

Maximum number of seconds to allow tabcmd to run before killing it.

type

integer

default

60

  • retries

Retries

Maximum number of times to retry a failed tabcmd.

type

integer

default

3

  • no_certcheck

No Certcheck

If true, do not check TLS certificate validity of server.

type

boolean

default

True

  • port

Port

TCP/IP port tabcmd should use when contacting server.

type

integer

  • proxy

Proxy

Hostname or IP address of proxy to use when contacting server.

type

string

#/definitions/SmtpSection

SmtpSection

Defines the characteristics of the SMTP server that will be used to deliver exported reports.

type

object

properties

  • 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

  • server

Server

Hostname or IP address of server.

type

string

  • username

Username

SMTP user name.

type

string

  • password

Password

Password for SMTP user name.

type

string

  • disabled

Disabled

If True, email is not sent and the contents of this section are ignored. Primarily intended for testing.

type

boolean

default

False

#/definitions/ReportSpecificationTypeEnum

ReportSpecificationTypeEnum

Specifies the format and location of the ReportSpecification.

type

string

enum

json, csv, sql

#/definitions/ReportTypeEnum

ReportTypeEnum

Specifies the format of the created report.

type

string

enum

pdf, csv, png, fullpdf

#/definitions/PagelayoutEnum

PagelayoutEnum

Specifies the page layout.

type

string

enum

landscape, protrait

#/definitions/PagesizeEnum

PagesizeEnum

Specifies the page size.

type

string

enum

unspecified, letter, legal, note, folio, tabloid, ledger, statement, executive, a3, a4, a5, b4, b5, quarto

#/definitions/ReportSpecification

ReportSpecification

Defines the contents of a single report.

type

object

properties

  • view

View

The Tableau view to use when creating the report. Views may contain spaces.

Example: If the Tableau URL is https://tableau.zuar.com/#/views/Superstore/Overview?:iid=1 then view is "Superstore/Overview".

type

string

  • report_type

The report’s format.

Examples:

"pdf"
"fullpdf"
"csv"
"png"

default

pdf

allOf

ReportTypeEnum

  • refresh

Refresh

type

boolean

default

False

  • height

Height

Height of the report image in pixels. Only valid when report_type is png.

type

integer

  • width

Width

Height of the report image in pixels. Only valid when if report_type is png.

type

integer

  • pagelayout

The page orientation of the report.

Examples:

"landscape"
"portrait"

default

landscape

allOf

PagelayoutEnum

  • pagesize

Assumed paper size to use when creating the report.

Examples:

"letter"
"a4"

default

letter

allOf

PagesizeEnum

  • report_name

Report Name

The name given to the exported report when it is attached to outgoing email. When the recipient saves the attachment, it will be saved using this name. Do not provide an extension (e.g., use "ceo_report" instead of "ceo_report.pdf"; the correct extension will be provided by tabcmd export.

type

string

default

default_report_name

  • mail_subject

Mail Subject

The subject line of the outgoing email.

Example:

"Q4 Results"

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

One or more comma-separated email addresses. The report will be emailed to the address(es).

Example:

"alice@foo.com,bob@foo.com,ted@bar.com"

type

string

  • mail_cc

Mail Cc

CC recipients. Otherwise, same as mail_to.

type

string

  • mail_bcc

Mail Bcc

BCC recipients. Otherwise, same as mail_to.

type

string

  • mail_body

Mail Body

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

Example:

"<html><head>CEO Report</head><body>Report attached.</body></head></html>"

type

string

default

This is the default email body.

  • disabled

Disabled

If True, the report defined by this specification is skipped.

Primarily for use with CSV input from a spreadsheet; it allows individual report specifications to be enabled/disabled without adding/removing rows from the spreadsheet.

type

boolean

default

False

#/definitions/ReportSpecificationsSection

ReportSpecificationsSection

Defines a section of the job’s JSON config containing the specifications for one or more reports that are to be exported and emailed.

type

object

properties

  • type

The format used in providing one or more report specifications.

"json": The report specifications will come from the job’s JSON config.

"csv": The report specifications will come from a CSV formatted file.

"sql": The report specifications will come from the results of an SQL query.

allOf

ReportSpecificationTypeEnum

  • source

Source

Provides the detailed specification for each report to be created.

If type is "json", source is a list of ReportSpecification or a valid JSON string representing a list of ReportSpecification.

Example:

"report_specifications": {
    "type": "json",
    "source": [
        {
            "view": "Superstore/Overview",
            "report_name": "report_name01",
            "mail_to": "steve@zuar.com",
            "mail_subject": "Report 01 is ready",
            "mail_from": "bob@zuar.com",
            "parameter_01": "Category",
            "value_01": '"Office Supplies"',
            "parameter_02": "State",
            "value_02": '["Texas", "Louisiana"]',
        },
        {
            "view": "Superstore/Overview",
            "report_name": "report_name02",
            "mail_to": "steve@zuar.com",
            "mail_subject": "Report 02 is ready",
            "mail_from": "bob@zuar.com",
            "parameter_01": "Category",
            "value_01": '["Furniture", "Office Supplies"]',
            "parameter_02": "State",
            "value_02": '"Louisiana"',
        }
    ]
}

If type is "csv", source is a path to a CSV file containing one report specification per row. The first row of the CSV file must be a header with column names corresponding to ReportSpecification attributes.

Example:

"report_specifications": {
    "type": "csv",
    "source": "/var/mitto/data/reports_01-02.csv"
}

Example contents of reports_01-02.csv:

view,report_type,pagelayout,pagesize,report_name,mail_to,mail_subject,mail_from,mail_cc,mail_bcc,parameter_01,value_01,parameter_02,value_02
Superstore/Overview,pdf,landscape,letter,khe_report_name01,khe@east.fm,keh subject 01,ke@east.fm,"kheaustin@gmail.com,kenneth.east@zuar.com",ke@east.fm,Category,""Office Supplies"",State,"[""Texas"", ""Louisiana""]"
Superstore/Overview,fullpdf,landscape,letter,Louisiana Report,"khe@east.fm,KHEAustin@gmail.com",keh subject 02,ke@east.fm,ke@east.fm,"kheaustin@gmail.com,kenneth.east@zuar.com",Category,"[""Furniture"", ""Office Supplies""]",State,""Louisiana""

If type is "sql", source is a SQL query that, when executed, will return one or more ReportSpecification. The SQL query can be either a single string containing the query or a list of strings that are concatenated to create the query.

The dbo attribute must be present when type is "sql".

Example:

"report_specifications": {
    "type": "sql",
    "source": [
        "SELECT",
        "'Superstore/Overview' AS view,",
        "'report_name01' AS report_name,",
        "'steve@zuar.com' AS mail_to,",
        "'Report 01 is ready' AS mail_subject,",
        "'bob@zuar.com' AS mail_from,",
        "'Category' AS parameter_01,",
        "'"Office Supplies"' AS value_01,",
        "'State' AS parameter_02,",
        "'["Texas", "Louisiana"]' AS value_02",
        "UNION ALL",
        "SELECT",
        "'Superstore/Overview' AS view,",
        "'report_name02' AS report_name,",
        "'steve@zuar.com' AS mail_to,",
        "'Report 02 is ready' AS mail_subject,",
        "'bob@zuar.com' AS mail_from,",
        "'Category' AS parameter_01,",
        "'["Furniture", "Office Supplies"]' AS value_01,",
        "'State' AS parameter_02,",
        "'"Louisiana"' AS value_02"
    ],
    "dbo": "postgresql://localhost/analytics"
}

Example:

"report_specifications": {
    "type": "sql",
    "source": "SELECT * FROM report_secification",
    "dbo": "postgresql://localhost/analytics"
}

anyOf

type

array

items

anyOf

ReportSpecification

type

string

type

string

  • dbo

Dbo

The database dbo to use when executing an SQL query to obtain report specificaitons.

Example:

"postgresql://localhost/analytics"

type

string

  • credentials

Credentials

Credentials name for the specified database dbo.

type

string

examples

“postgres_credentials”

  • specifications

Specifications

For internal use only. Results are undefined if a value is provided via the job’s JSON config.