Understanding a namespace
Section titled “Understanding a namespace”A namespace is the identity of a collection of files and folders; think of it as the analogue of a “drive” or “collection” in other systems. It is also the isolation boundary of the system: operations in a given namespace are isolated and consistent, cross-namespace operations are not.
See also Inodes & paths.
Naming a namespace
Section titled “Naming a namespace”A namespace ID can be supplied by the caller at creation time. If omitted, LoonFS generates one. While it is perfectly acceptable to choose human readable namespace names, most applications create namespaces programmatically with generated IDs.
Namespace ID rules:
| Rule | Detail |
|---|---|
| Length | 1–128 bytes |
| First character | A lowercase ASCII letter or a digit |
| Remaining characters | Lowercase ASCII letters, digits, ., _, or - |
| Not allowed | Leading or trailing whitespace; the exact values . and .. |
| Reserved | The loonfs- prefix |
Supported namespace operations
Section titled “Supported namespace operations”| Operation | Endpoint |
|---|---|
| Create namespace | POST /v0/namespaces |
| List namespaces | GET /v0/namespaces |
| Get namespace | GET /v0/namespaces/{namespace_id} |
| Fork namespace | POST /v0/namespaces/{namespace_id}/forks |
| Delete namespace | DELETE /v0/namespaces/{namespace_id} |
In the CLI, use namespace create, namespace list, namespace fork, namespace delete or use/current to select the active namespace.
Remember to include the required Loonfs-Actor header when creating or forking a namespace. The response records the actor ID as created_by. Permissions are selected per request: send Loonfs-Principals to check grants, or Loonfs-Context: service to act with the deployment token’s full authority. Forking requires this context; creating a namespace does not. Set initial grants with an update_access commit in service context. See Permissions.
Listing namespaces
Section titled “Listing namespaces”For now, LoonFS intentionally does not expose a list-namespaces operation. instead, applications should keep their own catalog of namespace IDs.
Forking a namespace
Section titled “Forking a namespace”Namespaces can be forked into new namespaces using a copy-on-write strategy. The fork belongs to the source’s pool and reuses its existing content.
The fork shares the source’s existing files instead of copying them. When forking the source’s current state, the fork folds recent writes from the source’s write-ahead log into its own manifest, so that fork can take a little longer.
Forking creates a fork snapshot on the source to protect inherited metadata, and a fork point snapshot on the new namespace to preserve its starting view. These pins last until the fork is retired and affect garbage collection.
Supply snapshot_id to fork a live snapshot’s captured state; otherwise the fork uses the source’s current head.
See Forking & merging for a complete workflow, and Data lifecycle for retention and retirement.