dap snapshot
Download complete snapshot of tables.
The dap snapshot command downloads full snapshots of datasets at a specific point in time. This is ideal for creating an initial full copy of the dataset or performing occasional full updates. Snapshots are useful for comprehensive analyses, audits, and backups.
Regular use of snapshots is not recommended, as they are resource-intensive for the API and costly to process on the client side.
Usage
dap [arguments] snapshot [flags]Options
--namespace <string>
Specifies the data source (namespace). Available options: {canvas, canvas_logs, catalog, new_quizzes}.
--table <string>
Specifies the table(s) to fetch data from. Can be a single table name, a comma separated list of table names or the special all keyword to fetch all tables in the namespace.
--format <string> (default: JSONL)
Defines the output format. Available options: {CSV, JSONL, Parquet, TSV}.
--output-directory <string>
Specifies the absolute or relative path to the output directory where the snapshot will be stored.
Global options
--client-id <string>
Client ID obtained from the Identity Service. Skip, if DAP_CLIENT_ID environment variable is set.
--client-secret <string>
Client Secret obtained from the Identity Service. Skip, if DAP_CLIENT_SECRET environment variable is set.
-h, --help
Displays help information for the command.
Output
Data files are written as gzipped files inside a job_<uuid>/ subdirectory of the output directory. Nothing is printed to stdout.
Each decompressed line (in JSONL format) is a JSON object with key, value, and meta fields:
meta.tsis the CDC timestamp for the record (ISO 8601, UTC).In snapshot data,
meta.actionis absent (it only appears in incremental results for deletes).Files are always gzipped regardless of
--format.Large tables may produce multiple
part-*files.
Error handling
Invalid table name
5
ERROR - Operation snapshot failed. Reason: The table name '<name>' specified in the request is not valid.
Invalid namespace
5
ERROR - The namespace '<name>' specified in the request is not valid.
Missing required flag
2
Error: Missing option '--table'.
Examples
Get a snapshot of the courses table from the canvas namespace:
$ dap snapshot --namespace canvas --table courses
Get a snapshot of multiple tables or all tables of the canvas namespace:
$ dap snapshot --namespace canvas --table courses,users,wikis
$ dap snapshot --namespace canvas --table all
Get a snapshot of the web_logs table from canvas_logs namespace in CSV format:
$ dap snapshot --namespace canvas_logs --table web_logs --format csv
Get a snapshot to a specific directory for scripting:
$ dap --non-interactive --loglevel warning snapshot --namespace canvas --table accounts --output-directory ./data
Related Resources
Last updated
Was this helpful?