Update dataset
Changes dataset properties.
This operation requires space_manage_datasets privilege.
Example cURL requests
Change dataset protection flags
curl -H "X-Auth-Token: $TOKEN" -X PATCH "https://$PROVIDER_HOST/api/v3/oneprovider/datasets/$DATASET_ID" \
-H "Content-Type: application/json" -d '{
"setProtectionFlags": ["metadata_protection"],
"unsetProtectionFlags": ["data_protection"]
}'
Path parameters
| Parameter | Type & Description |
|---|---|
| did required | string Dataset Id |
Request body
Dataset properties
The state of the dataset:
attached- the dataset is coupled with its root file/directory, which means that the file/directory is treated as a dataset and offers some additional features (e.g. protection flags). The root file/directory contents are directly the dataset contents.detached- the dataset is decoupled from its root file/directory and serves only archival purposes. The dataset does not correspond to any physical content in the file tree and changes to the original root file/directory contents are not reflected in the dataset.A
detacheddataset can be reattached, but only to the original file/directory and only if it still exists. Once a dataset has been established, its root file/directory can no longer be changed.
Dataset protection flags:
data_protection- causes all dataset's files and directories to be protected from modifying their content.metadata_protection- causes all dataset's files and directories to be protected from modifying their metadata (custom metadata, ACL, etc.). Can be enabled only whendata_protectionis enabled.
NOTE: the file/directory can be deleted if data_protection flag is disabled,
or when the flag is enabled but is inherited through one of its hard links.
Requests to modify the data/metadata when protection is enabled will be rejected with the EPERM POSIX error.
The protection flags are ignored when the dataset is in detached state.
Changing the protection flags may not have an immediate effect, especially for files that were already opened before the change.
Note however that some basic readonly file attributes (such as e.g. atime
updated when a file is read) will be modified regardless.
Dataset protection flags:
data_protection- causes all dataset's files and directories to be protected from modifying their content.metadata_protection- causes all dataset's files and directories to be protected from modifying their metadata (custom metadata, ACL, etc.). Can be enabled only whendata_protectionis enabled.
NOTE: the file/directory can be deleted if data_protection flag is disabled,
or when the flag is enabled but is inherited through one of its hard links.
Requests to modify the data/metadata when protection is enabled will be rejected with the EPERM POSIX error.
The protection flags are ignored when the dataset is in detached state.
Changing the protection flags may not have an immediate effect, especially for files that were already opened before the change.
Note however that some basic readonly file attributes (such as e.g. atime
updated when a file is read) will be modified regardless.
Request Examples
{
"setProtectionFlags": [
"data_protection"
]
}Responses
Dataset's properties has been changed.
Invalid request.
error object (ErrorJson) Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
ctx required object (ErrorJsonCtx) Technical information about error.
Technical information about error.
Timestamp in milliseconds.
Release version of a product, for example "25.1".
Identifier of a service instance — either Oneprovider Id or "onezone".
Domain of the service.
Build version of the service.
Short name of service.
Revision of onedata-errors repo, where the error is defined.
Module where the error occurred.
Line number in the module where the error occurred.
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.1",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}Forbidden request.
error object (ErrorJson) Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
ctx required object (ErrorJsonCtx) Technical information about error.
Technical information about error.
Timestamp in milliseconds.
Release version of a product, for example "25.1".
Identifier of a service instance — either Oneprovider Id or "onezone".
Domain of the service.
Build version of the service.
Short name of service.
Revision of onedata-errors repo, where the error is defined.
Module where the error occurred.
Line number in the module where the error occurred.
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.1",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}Dataset not found.
error object (ErrorJson) Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
ctx required object (ErrorJsonCtx) Technical information about error.
Technical information about error.
Timestamp in milliseconds.
Release version of a product, for example "25.1".
Identifier of a service instance — either Oneprovider Id or "onezone".
Domain of the service.
Build version of the service.
Short name of service.
Revision of onedata-errors repo, where the error is defined.
Module where the error occurred.
Line number in the module where the error occurred.
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.1",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}Internal server error.
error object (ErrorJson) Object describing an error.
Object describing an error.
String identifying the error type. Does not change between error instances.
Human readable error description. May contain information specific to given error instance.
Details about the error instance. The object schema is specific to each error type.
ctx required object (ErrorJsonCtx) Technical information about error.
Technical information about error.
Timestamp in milliseconds.
Release version of a product, for example "25.1".
Identifier of a service instance — either Oneprovider Id or "onezone".
Domain of the service.
Build version of the service.
Short name of service.
Revision of onedata-errors repo, where the error is defined.
Module where the error occurred.
Line number in the module where the error occurred.
Example
{
"error": {
"id": "example",
"description": "This is an example error.",
"ctx": {
"timestamp": 1750762637248,
"serviceReleaseVersion": "25.1",
"serviceId": "a7ee2722915b8bf7fb064eb65087cc61ch9357",
"serviceDomain": "dev-oneprovider-krakow.default.svc.cluster.local",
"serviceBuildVersion": "231-g8d26f953c3",
"service": "opw",
"onedataErrorsRevision": "ca3af8cb",
"module": "metadata_req",
"line": 45
}
}
}