diff --git a/website/docs/services/swift.mdx b/website/docs/services/swift.mdx new file mode 100644 index 000000000000..bec27ea6f63a --- /dev/null +++ b/website/docs/services/swift.mdx @@ -0,0 +1,70 @@ +--- +title: Swift +--- + +[OpenStack Swift](https://docs.openstack.org/api-ref/object-store/) service support. + +import Docs from '../../../core/src/services/swift/docs.md' + + + +### Via Config + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +```rust +use anyhow::Result; +use opendal::Operator; +use opendal::Scheme; +use std::collections::HashMap; + +#[tokio::main] +async fn main() -> Result<()> { + let mut map = HashMap::new(); + map.insert("endpoint".to_string(), "http://127.0.0.1:8080".to_string()); + map.insert("account".to_string(), "test_account".to_string()); + map.insert("container".to_string(), "test_container".to_string()); + map.insert("token".to_string(), "test_token".to_string()); + map.insert("root".to_string(), "/".to_string()); + + let op: Operator = Operator::via_map(Scheme::Swift, map)?; + Ok(()) +} +``` + + + + +```javascript +import { Operator } from "opendal"; +async function main() { + const op = new Operator("swift", { + endpoint: "http://127.0.0.1:8080", + account: "test_account", + container: "test_container", + token: "test_token", + root: "/", + }); +} +``` + + + + +```python +import opendal +op = opendal.Operator("swift", + endpoint="http://127.0.0.1:8080" + account="test_account", + container="test_container", + token="test_token", + root="/", +) +``` + + + \ No newline at end of file