Dataset Writing#

When connected to an ODC Database, these methods are available for adding, updating and archiving datasets:

dc = Datacube()
dc.index.datasets.{method}

add(dataset[, with_lineage, archive_less_mature])

Add dataset to the index.

add_location(id_, uri)

Add a location to the dataset if it doesn't already exist.

archive(ids)

Mark datasets as archived

archive_location(id_, uri)

Archive a location of the dataset if it exists and is active.

remove_location(id_, uri)

Remove a location from the dataset if it exists.

restore(ids)

Mark datasets as not archived

restore_location(id_, uri)

Un-archive a location of the dataset if it exists.

update(dataset[, updates_allowed, ...])

Update dataset metadata and location :param Dataset dataset: Dataset model with unpersisted updates :type updates_allowed: Optional[Mapping[Tuple[Union[str, int], ...], Callable[[Tuple[Union[str, int], ...], Tuple[Union[str, int], ...], Union[MissingSentinel, str, int, None, Sequence[Any], Mapping[str, Any]], Union[MissingSentinel, str, int, None, Sequence[Any], Mapping[str, Any]]], bool]]] :param updates_allowed: Allowed updates :type archive_less_mature: Optional[int] :param archive_less_mature: Find and archive less mature datasets with ms delta :rtype: Dataset :return: Persisted dataset model