Namespaces Replication
Every registered namespaces replication instance operation, with source-derived inputs, outputs, access policy, and errors.
This reference covers 5 HTTP operations registered by the Akasha daemon. Call these paths on your instance base URL. See authentication, errors, and coverage before integrating.
| Method | Path | Operation |
|---|---|---|
GET | /v1/dataspaces | Dataspaces list |
POST | /v1/namespace/switch | Namespace switch |
POST | /v1/replication/links | Replication create |
POST | /v1/replication/stop | Replication stop |
POST | /v1/replication/status | Replication status |
GET /v1/dataspaces
Dataspaces list
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
Request
No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.
Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::to_value(list).unwrap_or(serde_json::json!([])),Errors and validation
Directly referenced error variants: Internal. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:3461. Registration: akasha-daemon/src/main.rs:4584.
POST /v1/namespace/switch
Namespace switch
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | KV |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
Request
Json — NamespaceSwitchReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
tenant_id | String | Yes | |
reservoir_id | String | Yes | |
agent_id | String | Yes | |
dataspace_id | String | Yes |
struct NamespaceSwitchReq {
tenant_id: String,
reservoir_id: String,
agent_id: String,
dataspace_id: String,
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({
"ok": true,
"namespace": {
"tenant_id": namespace.tenant_id.to_string(),
"reservoir_id": namespace.reservoir_id.to_string(),
"agent_id": namespace.agent_id.to_string(),
"dataspace_id": namespace.dataspace_id.to_string(),
}
})Errors and validation
Directly referenced error variants: Internal, InvalidRequest, Unauthorized. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:3484. Registration: akasha-daemon/src/main.rs:4585.
POST /v1/replication/links
Replication create
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
Request
Json — ReplicationCreateReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
dest_data_dir | String | Yes | |
link_id | Option<String> | No; optional or defaulted |
struct ReplicationCreateReq {
dest_data_dir: String,
link_id: Option<String>,
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({"link_id": link_id.to_string()})Errors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:3547. Registration: akasha-daemon/src/main.rs:4586.
POST /v1/replication/stop
Replication stop
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
Request
Json — ReplicationIdReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
id | String | Yes |
struct ReplicationIdReq {
id: String,
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({"stopped": true})Errors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:3583. Registration: akasha-daemon/src/main.rs:4587.
POST /v1/replication/status
Replication status
| Availability | Source contract |
|---|---|
| Registration | config.enable_kv |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
Request
Json — ReplicationIdReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
id | String | Yes |
struct ReplicationIdReq {
id: String,
}Response
Declared return: Result<impl IntoResponse, DaemonError>
The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.
serde_json::json!({"running": running})Errors and validation
Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.
Source: akasha-daemon/src/main.rs:3599. Registration: akasha-daemon/src/main.rs:4588.