Skip to content

Dataset Snapshot

Generated by scripts/generate_docs.py (scripts/regen_docs.sh). Do not edit by hand.

Methods of client.dataset_snapshot (reportnet_api.resources.dataset_snapshot.DatasetSnapshotResource). Every method also exists on AsyncReportnetClient as await a_client.dataset_snapshot.<name>(...) with the same arguments. Roles are copied from the API spec; where it states none, this page says so rather than guessing.

Back to index

Methods

delete_snapshot

Delete dataset snapshot by snapshot id

HTTP: DELETE /snapshot/v1/{idSnapshot}/dataset/{idDataset}/delete

Call: client.dataset_snapshot.delete_snapshot(...) (async client: await a_client.dataset_snapshot.delete_snapshot(...))

Argument Type Required Default Description
id_dataset int yes Dataset id
id_snapshot int yes Snapshot id

Returns: None

Allowed roles:

Dataset type Roles
Reporting dataset STEWARD, LEAD REPORTER, CUSTODIAN, REPORTER WRITE
Data collection CUSTODIAN, STEWARD
Test dataset CUSTODIAN, STEWARD, STEWARD SUPPORT
Reference dataset CUSTODIAN, STEWARD

Live-tested notes:

  • Passed the role/type check on the scratch dataset (reached a 500 'no such snapshot entity'), unlike the historic-releases methods.

download_historic_releases_csv

downloadHistoricReleasesCSV

HTTP: GET /snapshot/downloadHistoricReleases/{datasetId}

Call: client.dataset_snapshot.download_historic_releases_csv(...) (async client: await a_client.dataset_snapshot.download_historic_releases_csv(...))

Argument Type Required Default Description
dataflow_id int yes
dataset_id int yes
file_name str yes
dest str \| os.PathLike[str] yes
process_id str \| None no None

Returns: None

Allowed roles:

Not stated in the API spec.

Caution: if the export identified by process_id is still in progress or was canceled, the backend answers 200 with a plain-text "not ready" message instead of CSV, and that text is what lands in dest. Check the file content before trusting it.

Live-tested notes:

  • Same 403 as historic_releases with an elevated credential on a Design dataset (suspected exclusion, unconfirmed). A not-ready export answers 200 with plain text, which lands in dest; check the file.

export_historic_releases_csv

exportHistoricReleasesCSV

HTTP: POST /snapshot/exportHistoricReleases/{datasetId}

Call: client.dataset_snapshot.export_historic_releases_csv(...) (async client: await a_client.dataset_snapshot.export_historic_releases_csv(...))

Argument Type Required Default Description
dataflow_id int yes
dataset_id int yes

Returns: str

Allowed roles:

Not stated in the API spec.

Returns the download URL string (not CSV content): the backend starts an async export and answers with /snapshot/downloadHistoricReleases/{id}?dataflowId=..&fileName=..&processId=... Pass its fileName/processId to download_historic_releases_csv.

Live-tested notes:

  • Also 403 with the elevated credential on the scratch (Design) dataset (same suspected exclusion, unconfirmed). Returns a URL string, not CSV.

historic_releases

Get dataset historic releases by dataset id

HTTP: GET /snapshot/v1/historicReleases

Call: client.dataset_snapshot.historic_releases(...) (async client: await a_client.dataset_snapshot.historic_releases(...))

Argument Type Required Default Description
dataflow_id int \| None no None Dataflow id
dataset_id int yes Dataset id

Returns: list[ReleaseVO]

Allowed roles:

Dataset type Roles
Reporting dataset CUSTODIAN, STEWARD
Data collection CUSTODIAN, STEWARD
EU dataset CUSTODIAN, STEWARD

Live-tested notes:

  • Got 403 even with a Bearer Custodian/Steward credential on the scratch dataset, so it is not just a role gate. That dataset is confirmed to be a Design dataset; the suspected (unconfirmed) cause is that historic releases do not apply to them.