AtomicServer
Atomic-Server services support.
Capabilities
This service can be used to:
- stat
- read
- write
- create_dir
- delete
- copy
- rename
-
list -
presign - blocking
Configuration
root
: Set the working directory ofOpenDAL
endpoint
: Set the server address forAtomicserver
private_key
: Set the private key for agent used forAtomicserver
public_key
: Set the public key for agent used forAtomicserver
parent_resource_id
: Set the parent resource id (url) thatAtomicserver
uses to store resources under
You can refer to [AtomicserverBuilder
]'s docs for more information.
Example
Via Builder
use anyhow::Result;
use opendal::services::Atomicserver;
use opendal::Operator;
#[tokio::main]
async fn main() -> Result<()> {
let mut builder = Atomicserver::default();
// Set the server address for Atomicserver
builder.endpoint("http://localhost:9883");
// Set the public/private key for agent for Atomicserver
builder.private_key("<private_key>");
builder.public_key("<public_key>");
// Set the parent resource id for Atomicserver. In this case
// We are using the root resource (Drive)
builder.parent_resource_id("http://localhost:9883");
let op: Operator = Operator::new(builder)?.finish();
Ok(())
}
Via Config
- Rust
- Node.js
- Python
use anyhow::Result;
use opendal::services::Sqlite;
use opendal::Operator;
#[tokio::main]
async fn main() -> Result<()> {
let mut map = HashMap::new();
map.insert("endpoint".to_string(), "http://localhost:9883".to_string());
map.insert("private_key".to_string(), "your_private_key".to_string());
map.insert("public_key".to_string(), "your_public_key".to_string());
map.insert("parent_resource_id".to_string(), "your_resource_id".to_string());
let op: Operator = Operator::via_map(Scheme::Atomicserver, map)?;
Ok(())
}
import { Operator } from require('opendal');
async function main() {
const op = new Operator("atomicserver", {
endpoint: 'http://localhost:9883',
private_key: 'your_private_key',
public_key: 'your_public_key',
parent_resource_id: 'your_resource_id',
});
}
import opendal
op = opendal.Operator("atomicserver", {
"connection_string": "http://localhost:9883",
"private_key": "your_private_key",
"public_key": "your_public_key",
"parent_resource_id": "your_resource_id",
})