create_remote_node_storage_target
const url = 'https://example.com/api/v1/admin/remote-nodes/1/storage-targets';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"connection":{"connector_config":{"connector_id":"example","format_version":1,"schema_version":1,"values":{"additionalProperty":true}},"credential":{"mode":"none"}},"name":"example"}'};
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/remote-nodes/1/storage-targets";
let payload = json!({ "connection": json!({ "connector_config": json!({ "connector_id": "example", "format_version": 1, "schema_version": 1, "values": json!({"additionalProperty": true}) }), "credential": json!({"mode": "none"}) }), "name": "example" });
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/remote-nodes/1/storage-targets \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "connection": { "connector_config": { "connector_id": "example", "format_version": 1, "schema_version": 1, "values": { "additionalProperty": true } }, "credential": { "mode": "none" } }, "name": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Remote node ID
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Persisted configuration for exactly one connector.
A storage policy currently has one active connector, so a map of historical namespaces would only create ambiguous ownership. If the connector is temporarily unavailable, this entire envelope is preserved byte-for-byte.
object
Stable connector/plugin identifier.
Built-in connectors use reverse-DNS-style identifiers such as
asterdrive.storage.local. Dynamically loaded plugins use the same type and
registry path, so core code never needs a built-in connector enum.
Responses
Section titled “Responses”Remote node storage target created
统一 API 响应格式
成功: { "code": "success", "msg": "", "data": {...} }
失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }
object
object
Persisted configuration for exactly one connector.
A storage policy currently has one active connector, so a map of historical namespaces would only create ambiguous ownership. If the connector is temporarily unavailable, this entire envelope is preserved byte-for-byte.
object
Stable connector/plugin identifier.
Built-in connectors use reverse-DNS-style identifiers such as
asterdrive.storage.local. Dynamically loaded plugins use the same type and
registry path, so core code never needs a built-in connector enum.
object
object
Connector-owned field that caused a configuration validation failure.
This is intentionally optional so existing diagnostics remain wire-compatible.
Connector field scope, for example connector_config or static_credential.
Example
{ "code": "success"}Unauthorized
Forbidden
Remote node not found
Remote storage targets require a single primary binding