Create file or directory
Creates a file or directory in the directory specified by $PARENT_ID. The data sent in request body (if any) will be saved as file content.
Example cURL requests
Create file
curl -H "X-Auth-Token: $TOKEN" \
-X POST "https://$HOST/api/v3/oneprovider/data/$PARENT_ID/children?name=$FILE_NAME" \
-H "Content-Type: application/octet-stream" -d "@file.dat"
{
"fileId": "094576776E667431723230677767776C6B497031394E445F6E3868677873..."
}
Create directory
curl -H "X-Auth-Token: $TOKEN" \
-X POST "https://$HOST/api/v3/oneprovider/data/$PARENT_ID/children?name=$DIR_NAME&type=dir" \
{
"fileId": "000000006CB6637368617265477569642333396432363661656463656266..."
}
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Id of the parent directory. |
Query parameters
| Parameter | Type & Description |
|---|---|
| name required | string Name of the file. |
| type | string Type of the file. |
| mode | integer POSIX file permissions in decimal format. |
| offset | integer Offset at which data sent as request body should be written to file. |
Request body
File content to be written at specified offset.
No schema provided.
Request Examples
oneprovider-rest-cli createFile id=$PARENT_ID name=$FILE_NAMEResponses
The request has been accepted and the result is the file Id. Also URI of the file in form https://$HOST/api/v3/oneprovider/data/{id} is returned in the response Location header.
file 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."
}