Email and schedule weekly DCT reports via API

Data Control Tower (DCT) has a wide variety of reports such as VDB summaries, data at risk, and storage capacity. Using the DCT API, you can automate and schedule the sending of any DCT report, whether for audit purposes or simply as a reminder.

Before beginning, please look over the API summary and API references pages. Remember to specify apk when entering your API key.

Configure SMTP

The SMTP server is what allows the email to be sent from DCT to your email address. This is done via PUT/management/smtp — Update SMTP Config.

A sample cURL command in this regard might appear as:

Copy
curl -X 'PUT' \
    'https://uvo1bb1czfei9h6qjyy.vm.cld.sr/dct/v3/management/smtp' \
    -H 'Authorization: apk <YOUR_API_KEY>' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{ 
        "server": "smtp.gmail.com",
        "port": 587,
        "authentication_enabled": true,
        "tls_enabled": true,
        "username": "<TEST_USERNAME>",
        "password": "<TEST_PASSWORD>"
        "from_address": "test@email.com" 
    } ' 

There are various, free test SMTP servers, such as smtp.gmail.com—but for production usage, work with your IT team directly to identify the correct SMTP server.

Lastly, the PUT/management/smtp/validate API can help confirm the SMTP is working before you start scheduling any reports.

Schedule the report

This step consists of choosing the report and scheduling it, done via PUT/reporting/schedule — Create a new report schedule.

A sample cURL command in this regard might appear as:

Copy
curl -X 'PUT' \
    'https://uvo1bb1czfei9h6qjyy.vm.cld.sr/dct/v3/reporting/schedule' \
    -H 'accept: application/json' \
    -H 'Authorization: apk <YOUR_API_KEY>' \
    -H 'Content-Type: application/json' \
    -d '{ 
        "report_type": "VIRTUALIZATION_STORAGE_SUMMARY",
        "cron_expression": "0 * * ? * *",
        "time_zone": "UTC",
        "message": "Delphix storage summary",
        "file_format": "CSV",
        "enabled": true,
        "recipients": [ "test@email.com", “test2@email.com” ] 
    } ' 

The available options for report_type include:

 

Data governance

  • Data at Risk — DATA_RISK_SUMMARY

Data

  • VDB Inventory — VDB_INVENTORY_DATA

  • dSource Inventory — DSOURCE_USAGE_DATA

  • Engine Performance — ENGINE_PERFORMANCE_ANALYTIC

Compliance

  • Job Executions — MASKING_EXECUTION_METRICS

  • Engine Performance — ENGINE_PERFORMANCE_ANALYTIC

  • Engine State — None

Storage

  • Block Storage — VIRTUALIZATION_STORAGE_SUMMARY

  • Storage Savings — STORAGE_SAVINGS_SUMMARY

System

  • Source Ingestion — DSOURCE_CONSUMPTION_DATA

  • Account Activity — AUDIT_LOGS_SUMMARY

 

Make sure to configure the cron_expression and time_zone values to get the desired cadence. Delphix uses Quartz cron expression formatting. Here are a few examples:

  • 0 0 9 * * ? — Every day at 9 am

  • 0 0 9 ? * 2/7 * — Every Monday at 9 am

  • 0 * * ? * * — Every minute

If you are unfamiliar with Quartz cron expression formatting, there are tools online that can help.

If you ever need to modify the configuration of the weekly report, simply run the update API command again, but with the values modified. Setting the enabled value to false will also disable the scheduler.

Advanced: Filter and refine the report

In addition to using the out-of-the-box reports, you can also customize and refine them further to build your own, which can then be delivered as a CSV. However, these customized reports cannot be sent via the scheduler at this time.

  • Filter Expression: This special regex-like formatting focuses on specific objects or tags. If unfamiliar, the “Advanced Search” in many of the Data tab’s UI might provide some initial guidance.

  • Sort: This allows you to sort in ascending or descending order when the CSV is sent.

  • Limit: If you are noticing slowness around the run time, then consider shrinking the limit or further consolidating the filter expression to focus on a few values.

Schedule multiple reports

If you need additional reports scheduled, re-run the POST reporting/schedule API called above, but specify a different report, cadence, or email recipient.

Lastly, if you need to clean up, use the GET reporting/schedule API call to see the configured schedules and run DELETE reporting/schedule/{scheduleId} to remove it.