Onedata API Reference

REST API references for Onezone, Oneprovider, and Onepanel.

Create transfer

POST /transfers

Creates transfer, which is a process of data movement between providers. This operation is asynchronous and it can take a long time depending on the size of the data to move.

The following types of transfer are supported:

  • replication - process of copying data to achieve a complete replica in provider specified as replicatingProviderId. The data will be copied from one or more providers in the space that hold replicas or some fragments. This operation requires space_schedule_replication privilege.
  • eviction - process of removing replica(s) from provider specified in evictingProviderId. Eviction is safe - will succeed only if there is at least one complete replica (accumulated) on other providers in the space. This operation requires space_schedule_eviction privilege.
  • migration - replication followed by eviction. This operation requires both space_schedule_replication and space_schedule_eviction privileges.

Each transfer applies to one or more files/directories, depending on chosen dataSourceType:

  • file - a single chosen file or directory
  • view - all files that are returned as a result of querying chosen view

In case of a directory, the transfer applies to all its subfiles and subdirectories (recursively).

Example cURL requests

Create file replication

curl -H "X-Auth-Token: $TOKEN" -X POST "https://$PROVIDER_HOST/api/v3/oneprovider/transfers" \
-H "Content-Type: application/json" -d '{
    "type": "replication",
    "replicatingProviderId": "'$PROVIDER_ID'",
    "dataSourceType": "file",
    "fileId": "'$FILE_ID'"
}'

Request body

application/json

Transfer properties.

Property
Type & Description
type
string

Requested type of transfer. Depending on selected type specifying also replicatingProviderId, evictingProviderId or both may be required.

Enum:
replication eviction migration
replicatingProviderId
string

Id of provider to which data will be copied, ensuring that the provider has a complete replica at the end of the process. The data will be copied from one or more providers in the space that hold replicas or some fragments.

evictingProviderId
string

Id of provider from which replica(s) are to be removed. Eviction is safe - will succeed only if there is at least one complete replica (accumulated) on other providers in the space.

callback
string

This parameter allows the user to specify a REST callback URL which will be called (http POST request with transfer Id in body) when the transfer is complete.

dataSourceType
discriminator string

Indicates the method of determining files to be transferred.

type = "file" - this transfer covers a single file or a whole directory (recursively). When scheduling such transfer, the user must have permissions to access the file/directory.

Indicates the method of determining files to be transferred.

type = "view" - this transfer covers files that are returned as a result of querying chosen view. The view must be defined on all providers involved in the process and querying it must return a valid list of file ids to be transferred. For more information about views, please see here.

Request Examples

Shell
oneprovider-rest-cli createTransfer type==replication replicatingProviderId==$PROVIDER_ID dataSourceType==file fileId==$FILE_ID

Responses

application/json
201

The request has been accepted and the result is the transfer Id. Also URI of the transfer in form https://$PROVIDER_HOST/api/v3/oneprovider/transfers/{id} is returned in the response Location header.

Property
Type & Description
transferId
string

Transfer Id.

400

Invalid request.

Property
Type & Description
error
object (ErrorJson)

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

ctx required
object (ErrorJsonCtx)

Technical information about error.

timestamp required
integer

Timestamp in milliseconds.

serviceReleaseVersion required
string

Release version of a product, for example "25.1".

serviceId required
string

Identifier of a service instance — either Oneprovider Id or "onezone".

serviceDomain required
string

Domain of the service.

serviceBuildVersion required
string

Build version of the service.

service required
string

Short name of service.

Enum:
ozw opw ozp opp
onedataErrorsRevision required
string

Revision of onedata-errors repo, where the error is defined.

module required
string

Module where the error occurred.

line required
integer

Line number in the module where the error occurred.

Example

application/json
{
  "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
    }
  }
}
403

Forbidden request.

Property
Type & Description
error
object (ErrorJson)

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

ctx required
object (ErrorJsonCtx)

Technical information about error.

timestamp required
integer

Timestamp in milliseconds.

serviceReleaseVersion required
string

Release version of a product, for example "25.1".

serviceId required
string

Identifier of a service instance — either Oneprovider Id or "onezone".

serviceDomain required
string

Domain of the service.

serviceBuildVersion required
string

Build version of the service.

service required
string

Short name of service.

Enum:
ozw opw ozp opp
onedataErrorsRevision required
string

Revision of onedata-errors repo, where the error is defined.

module required
string

Module where the error occurred.

line required
integer

Line number in the module where the error occurred.

Example

application/json
{
  "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
    }
  }
}
404

File not found.

Property
Type & Description
error
object (ErrorJson)

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

ctx required
object (ErrorJsonCtx)

Technical information about error.

timestamp required
integer

Timestamp in milliseconds.

serviceReleaseVersion required
string

Release version of a product, for example "25.1".

serviceId required
string

Identifier of a service instance — either Oneprovider Id or "onezone".

serviceDomain required
string

Domain of the service.

serviceBuildVersion required
string

Build version of the service.

service required
string

Short name of service.

Enum:
ozw opw ozp opp
onedataErrorsRevision required
string

Revision of onedata-errors repo, where the error is defined.

module required
string

Module where the error occurred.

line required
integer

Line number in the module where the error occurred.

Example

application/json
{
  "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
    }
  }
}
500

Internal server error.

Property
Type & Description
error
object (ErrorJson)

Object describing an error.

id required
string

String identifying the error type. Does not change between error instances.

description required
string

Human readable error description. May contain information specific to given error instance.

details
object

Details about the error instance. The object schema is specific to each error type.

ctx required
object (ErrorJsonCtx)

Technical information about error.

timestamp required
integer

Timestamp in milliseconds.

serviceReleaseVersion required
string

Release version of a product, for example "25.1".

serviceId required
string

Identifier of a service instance — either Oneprovider Id or "onezone".

serviceDomain required
string

Domain of the service.

serviceBuildVersion required
string

Build version of the service.

service required
string

Short name of service.

Enum:
ozw opw ozp opp
onedataErrorsRevision required
string

Revision of onedata-errors repo, where the error is defined.

module required
string

Module where the error occurred.

line required
integer

Line number in the module where the error occurred.

Example

application/json
{
  "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
    }
  }
}