DCT Toolkit
Overview
DCT Toolkit (dct-toolkit) is a command-line tool that simplifies operations for Data Control Tower and is available as a supported Delphix product through the official download site. It is often used to incorporate Delphix test data management into application test automation or to invoke Delphix functions when building and running CI/CD pipelines, such as Jenkins.
dct-toolkit abstracts API-level implementation details and provides a user-friendly, Linux-like command interface that can be run from a terminal with minimal configuration and setup.
dct-toolkit is designed to work with DCT versions broadly, but Delphix fully supports it with DCT version 8.0.0 and later. While it can be used in test or development environments with other versions, Delphix recommends using DCT 8.0.0 or later in production environments. Some value-added features are supported only in DCT 8.0.0 and later.
How this helps
The advantages of dct-toolkit and the main considerations for using it can be summarized as follows:
-
Reduces the time required for coding and operational testing when creating scripts
-
Improves script readability and maintainability
-
Automatically makes new DCT APIs available when DCT is upgraded
Keep in mind that dct-toolkit requires a separate installation. In some cases, minor CLI-specific updates or changes may still require a toolkit upgrade.
dct-toolkit does not need to be upgraded for every DCT release. It reads the API specification from the configured DCT instance and dynamically generates the available commands and options. As a result, new APIs introduced in newer DCT releases are automatically available through the toolkit.
Because the CLI and API are closely aligned, new or updated API calls are reflected in dct-toolkit commands. If you are working through a CLI command and need a more visual reference, the Swagger API can help you confirm the underlying operation before returning to the CLI workflow.
Compare DCT access methods
The following table compares dct-toolkit with REST APIs and SDKs that can also be used to perform DCT operations and integrations.
| Category | REST API | SDK (Python or Go) | DCT Toolkit |
|---|---|---|---|
| Basic operation method | HTTP or HTTPS access through a browser, client commands such as cURL, scripts, or HTTP/HTTPS client libraries | Access throughs cripts or programs built with SDK modules that call DCT APIs | Command-based access through the toolkit |
| Authentication | API key authentication | API key authentication | API key authentication through the toolkit configuration |
| Functional completeness | Compatible with all functions | Compatible with all functions; SDK modules are generated for DCT releases | Designed for parity with DCT APIs |
| Return or command output | HTTP status and JSON output | HTTP status and JSON output | Command return values with selectable text, JSON, or CSV output |
| Filtering and output control | Requires manual parsing | Requires manual parsing in code | Supports output filtering and formatting through command options |
| Automation and script complexity | Medium | Medium | Low |
| Support | Full | Full | Full |
Scenario: refreshing a VDB from the most recent bookmark
Using the refresh operation for a VDB from the most recent bookmark as an example, the following comparison shows the difference between a REST API call and a dct-toolkit command.
REST API example
cat vdbrefresh_with_most_recent_bookmark.sh
#!/bin/bash
#
# sample script to refresh a VDB with the most recent bookmark.
#
DCTURL="https://10.160.1.170/dct/v3"
DCTKEY="2.ih3WU2HbpbCeeLDirxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
VDB_ID="2-ORACLE_DB_CONTAINER-4"
# Get ID of the most recent bookmark
BOOKMARK_ID=$(curl -s -X POST -k -d '' $DCTURL/vdbs/$VDB_ID/bookmarks/search?sort=-creation_date \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H "Authorization: apk $DCTKEY" | jq '.items[0] | .id' | tr -d '"')
# VDB refresh with bookmark
JOB_ID=$(curl -s -X POST -k --data @- $DCTURL/vdbs/$VDB_ID/refresh_from_bookmark \
-H 'accept: application/json' \
-H "Authorization: apk $DCTKEY" \
-H 'Content-Type: application/json' <<EOF | jq '.job.id' | tr -d '"'
{
"bookmark_id": "$BOOKMARK_ID"
}
EOF
)
# Check job status in a loop
JOB_STATUS="RUNNING"
while [ $JOB_STATUS != "COMPLETED" ]
do
JOB_STATUS=$(curl -s -X GET -k $DCTURL/jobs/$JOB_ID \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H "Authorization: apk $DCTKEY" | jq '.status' | tr -d '"')
echo -n "Job status: "
echo $JOB_STATUS
sleep 10
done
-
When you access DCT with curl or a similar command, you must include the DCT user API key in the request header.
-
Because the API response is returned in JSON format, tools such as jq are needed to extract output values.
-
When the operation API call completes successfully, the launched job information is returned in JSON format together with the API call result. Job progress and final completion or failure must then be checked separately through another API call, such as /jobs/{job_id}.
-
Asynchronous calls typically must be managed by the user.
DCT Toolkit example
dct-toolkit refresh_vdb_from_bookmark vdb_id=2-ORACLE_DB_CONTAINER-4 \
bookmark_id=$(dct-toolkit search_bookmarks_by_vdb vdb_id=2-ORACLE_DB_CONTAINER-4 \
sort=-creation_date -jp=$.items[0].id --json | tr -d '"')
--- {}
Asynchronous job 10ff6acc240d476790170fab51aca7c4 dispatched....
....................................................................
Asynchronous Job 10ff6acc240d476790170fab51aca7c4 terminated in state COMPLETED
echo $?
0
-
Because the connection destination and authentication information are defined in the configuration file, command arguments are simpler.
-
Output can be narrowed to specific values when needed.
-
Because the command completes when the job finishes or fails, no separate script or command is required to check job status.
-
Asynchronous calls are managed by the toolkit.