Create transfer
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 asreplicatingProviderId. The data will be copied from one or more providers in the space that hold replicas or some fragments. This operation requiresspace_schedule_replicationprivilege.eviction- process of removing replica(s) from provider specified inevictingProviderId. Eviction is safe - will succeed only if there is at least one complete replica (accumulated) on other providers in the space. This operation requiresspace_schedule_evictionprivilege.migration-replicationfollowed byeviction. This operation requires bothspace_schedule_replicationandspace_schedule_evictionprivileges.
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://$HOST/api/v3/oneprovider/transfers" \
-H "Content-Type: application/json" -d '{
"type": "replication",
"replicatingProviderId": $PROVIDER_ID,
"dataSourceType": "file",
"fileId": $FILE_ID
}'
Request body
Transfer properties.
Requested type of transfer. Depending on selected type specifying also replicatingProviderId, evictingProviderId or both may be required.
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.
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.
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.
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
oneprovider-rest-cli createTransfer type==replication replicatingProviderId==$PROVIDER_ID dataSourceType==file fileId==$FILE_IDResponses
The request has been accepted and the result is the transfer Id. Also URI of the transfer in form https://$HOST/api/v3/oneprovider/transfers/{id} is returned in the response Location header.
Transfer Id.
Invalid request.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Forbidden request.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}File not found.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Internal server error.
Identifier representing internal error code.
Detailed error message.
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}