promote_s3_compatible_policy_driver
POST
/api/v1/admin/policies/{id}/promote-s3-driver
const url = 'https://example.com/api/v1/admin/policies/1/promote-s3-driver';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"bucket":"example","endpoint":"example","target_driver_type":"local"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://example.com/api/v1/admin/policies/1/promote-s3-driver";
let payload = json!({ "bucket": "example", "endpoint": "example", "target_driver_type": "local" });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url https://example.com/api/v1/admin/policies/1/promote-s3-driver \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "bucket": "example", "endpoint": "example", "target_driver_type": "local" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer format: int64
Policy ID
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
Promote an S3-compatible storage policy to a specialized S3-compatible driver.
object
bucket
required
string
endpoint
required
string
target_driver_type
required
存储驱动类型
string
Responses
Section titled “Responses”Policy driver promoted
Media typeapplication/json
统一 API 响应格式
成功: { "code": "success", "msg": "", "data": {...} }
失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }
object
code
required
string
data
object
allowed_types
required
Array<string>
base_path
required
string
bucket
required
string
chunk_size
required
integer format: int64
created_at
required
string
driver_type
required
存储驱动类型
string
endpoint
required
string
id
required
integer format: int64
is_default
required
boolean
max_file_size
required
integer format: int64
name
required
string
options
required
object
content_dedup
boolean | null
media_metadata_extensions
Array<string>
object_storage_download_strategy
onedrive_account_mode
onedrive_cloud
onedrive_drive_id
string | null
onedrive_group_id
string | null
onedrive_root_item_id
string | null
onedrive_site_id
string | null
onedrive_tenant
string | null
provider_download_filename_mode
provider_resumable_upload_strategy
s3_connect_timeout_secs
integer | null format: int64
s3_operation_timeout_secs
integer | null format: int64
s3_path_style
boolean | null
s3_read_timeout_secs
integer | null format: int64
sftp_host_key_fingerprint
string | null
storage_native_media_metadata_enabled
boolean | null
storage_native_processing_enabled
boolean | null
thumbnail_extensions
Array<string>
remote_node_id
integer | null format: int64
remote_storage_target_key
string | null
updated_at
required
string
error
msg
required
string
Example
{ "code": "success", "data": { "driver_type": "local", "options": { "object_storage_download_strategy": "relay_stream", "object_storage_upload_strategy": "relay_stream", "onedrive_account_mode": "personal", "onedrive_cloud": "global", "provider_download_filename_mode": "provider_native", "provider_download_strategy": "server_relay", "provider_resumable_upload_strategy": "server_relay", "remote_download_strategy": "relay_stream", "remote_upload_strategy": "relay_stream", "thumbnail_processor": "images" } }}Promotion rejected
Unauthorized
Forbidden
Policy not found