Rename or move a file within a volume
import requests
url = "https://api.13-215-85-171.sslip.io/v1/volumes/{id}/files/rename"
payload = {
"old_path": "<string>",
"new_path": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/volumes/{id}/files/rename \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"old_path": "<string>",
"new_path": "<string>"
}
'{
"name": "<string>",
"path": "<string>",
"is_dir": true,
"size": 123,
"type": "file",
"mode": "0644",
"permissions": "0644",
"owner": "<string>",
"group": "<string>",
"modified_time": "2023-11-07T05:31:56Z",
"symlink_target": "<string>"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}{
"error": "Missing or invalid bearer credential",
"code": "unauthorized",
"request_id": "req_123"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}Volumes
Rename or move a file within a volume
POST
/
v1
/
volumes
/
{id}
/
files
/
rename
Rename or move a file within a volume
import requests
url = "https://api.13-215-85-171.sslip.io/v1/volumes/{id}/files/rename"
payload = {
"old_path": "<string>",
"new_path": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.13-215-85-171.sslip.io/v1/volumes/{id}/files/rename \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"old_path": "<string>",
"new_path": "<string>"
}
'{
"name": "<string>",
"path": "<string>",
"is_dir": true,
"size": 123,
"type": "file",
"mode": "0644",
"permissions": "0644",
"owner": "<string>",
"group": "<string>",
"modified_time": "2023-11-07T05:31:56Z",
"symlink_target": "<string>"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}{
"error": "Missing or invalid bearer credential",
"code": "unauthorized",
"request_id": "req_123"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}{
"error": "<string>",
"code": "invalid_request",
"error_detail": {
"code": "unauthorized",
"message": "<string>",
"phase": "auth",
"retryable": true,
"suggested_action": "<string>",
"step_index": 123,
"attempt": 123,
"max_attempts": 123,
"cache_subject": "<string>",
"build_id": "<string>",
"request_id": "<string>",
"details": {}
},
"request_id": "<string>",
"build_id": "<string>"
}Authorizations
API key passed as Bearer token
Path Parameters
Volume ID
Body
application/json
Response
Renamed file metadata
Absolute resolved filesystem path. For machine routes this is an absolute machine path; for volume routes this is an absolute volume-internal path rooted at /.
Entry type (e.g. "file", "directory", "symlink")
Example:
"file"
Example:
"0644"
Example:
"0644"