Skip to content

Commit

Permalink
Fixing adminspace commands
Browse files Browse the repository at this point in the history
Fixing adminspace commands
  • Loading branch information
OlivierHecart authored Feb 12, 2025
2 parents 6b2aed6 + d042bb3 commit 8d84356
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions content/docs/APIs/REST.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Examples using curl:
curl -X PUT -H "content-type:application/json" -d '{"value": "Hello World!"}' http://localhost:8000/demo/example/test

# Create a Memory storage on demo/test/** via a Put on admin space (@/...)
curl -X PUT -H 'content-type:application/json' http://localhost:8000/@/router/local/config/plugins/storage_manager/storages/demo -d '{key_expr:"demo/test/**", volume:"memory"}'
curl -X PUT -H 'content-type:application/json' http://localhost:8000/@/local/router/config/plugins/storage_manager/storages/demo -d '{key_expr:"demo/test/**", volume:"memory"}'
```
### DELETE
Expand All @@ -118,6 +118,6 @@ Examples using curl:
curl -X DELETE http://localhost:8000/demo/example/test

# Remove a storage via a Remove on admin space (@/...)
curl -X DELETE http://localhost:8000/@/router/local/config/plugins/storage_manager/storages/demo
curl -X DELETE http://localhost:8000/@/local/router/config/plugins/storage_manager/storages/demo
```
6 changes: 3 additions & 3 deletions content/docs/getting-started/quick-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ The complete Eclipse zenoh's key/value space is accessible through the REST API,

* Get info of the local Zenoh router:
```bash
curl http://localhost:8000/@/router/local
curl http://localhost:8000/@/local/router
```
* Add a memory storage on `demo/example/**`:
```bash
curl -X PUT -H 'content-type:application/json' -d '{key_expr:"demo/example/**", volume: "memory"}' http://localhost:8000/@/router/local/config/plugins/storage_manager/storages/demo
curl -X PUT -H 'content-type:application/json' -d '{key_expr:"demo/example/**", volume: "memory"}' http://localhost:8000/@/local/router/config/plugins/storage_manager/storages/demo
```
* Get the storages of the local router (should return the "demo" storage that has just been created):
```bash
curl 'http://localhost:8000/@/router/local/status/plugins/storage_manager/storages/*'
curl 'http://localhost:8000/@/local/router/status/plugins/storage_manager/storages/*'
```

### Put/Get into Zenoh
Expand Down
2 changes: 1 addition & 1 deletion content/docs/manual/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Remember to enable the REST plugin in `zenohd` with the command line option `--r

To do this, use commands such as
```bash
curl -X PUT http://localhost:8000/@/router/local/config/plugins/storage_manager/storages/my-storage -d '{key_expr:"demo/mystore/**", volume:{id:"memory"}}'
curl -X PUT http://localhost:8000/@/local/router/config/plugins/storage_manager/storages/my-storage -d '{key_expr:"demo/mystore/**", volume:{id:"memory"}}'
# ^- REST plugin addr ^ ^--- config space --^ ^---- the path to the configured value ---^ ^-------------- the value to insert ----------------^
```

Expand Down
12 changes: 6 additions & 6 deletions content/docs/manual/plugin-storage-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,20 @@ fetch('http://hostname:8000/key/expression', {
To create a volume, add an entry describing it to the configuration. Let's say you'd like to create "my-volume" on a node that had the influxdb daemon listen on port 8086:

```bash
curl -X PUT 'http://hostname:8000/@/router/local/config/plugins/storage_manager/volumes/my-volume' -H 'content-type:application/json' -d '{"backend": "influxdb", "url": "http://localhost:8086"}'
curl -X PUT 'http://hostname:8000/@/local/router/config/plugins/storage_manager/volumes/my-volume' -H 'content-type:application/json' -d '{"backend": "influxdb", "url": "http://localhost:8086"}'
```

Note that if you only planned on having a single volume relying on influxdb, you might as well name that volume "influxdb", saving you the need to specify that the "influxdb" backend is the one you want to use:

```bash
curl -X PUT 'http://hostname:8000/@/router/local/config/plugins/storage_manager/volumes/influxdb' -H 'content-type:application/json' -d '{"url": "http://localhost:8086"}'
curl -X PUT 'http://hostname:8000/@/local/router/config/plugins/storage_manager/volumes/influxdb' -H 'content-type:application/json' -d '{"url": "http://localhost:8086"}'
```

### Removing a volume
To remove a volume, simply delete its entry from the configuration with:

```bash
curl -X DELETE 'http://hostname:8000/@/router/local/config/plugins/storage_manager/volumes/my-volume'
curl -X DELETE 'http://hostname:8000/@/local/router/config/plugins/storage_manager/volumes/my-volume'
```

The storage manager will delete the associated storages as well.
Expand All @@ -131,19 +131,19 @@ You can add storages at any time by adding them to the configuration through the

The simplest volume to use is the integrated "memory" volume, since it requires no extra configuration. Let's have "my-storage" work on `demo/my-storage/**`:
```bash
curl -X PUT 'http://hostname:8000/@/router/local/config/plugins/storage_manager/storages/my-storage' -H 'content-type:application/json' -d '{"key_expr": "demo/my-storage/**", "volume": "memory"}'
curl -X PUT 'http://hostname:8000/@/local/router/config/plugins/storage_manager/storages/my-storage' -H 'content-type:application/json' -d '{"key_expr": "demo/my-storage/**", "volume": "memory"}'
```

Some volumes, like that "my-volume" one we created [earlier](#adding-a-volume), need a bit more configuration. Any volume supported by the `influxdb` backend, for example, needs to know on what database to store the data associated with each storage through a `db` argument:
```bash
curl -X PUT 'http://hostname:8000/@/router/local/config/plugins/storage_manager/storages/my-other-storage' -H 'content-type:application/json' -d '{"key_expr": "demo/my-other-storage/**", "volume": {"id": "my-volume", "db": "MyOtherStorage"}}'
curl -X PUT 'http://hostname:8000/@/local/router/config/plugins/storage_manager/storages/my-other-storage' -H 'content-type:application/json' -d '{"key_expr": "demo/my-other-storage/**", "volume": {"id": "my-volume", "db": "MyOtherStorage"}}'
```

### Removing a storage
Just like volumes, removing a storage is as simple as deleting its entry in the configuration. Note that removing a volume's last storage will not remove that volume: volumes with 0 storages depending on them are perfectly legal.

```bash
curl -X DELETE 'http://hostname:8000/@/router/local/config/plugins/storage_manager/storages/my-storage'
curl -X DELETE 'http://hostname:8000/@/local/router/config/plugins/storage_manager/storages/my-storage'
```

### Checking a volume's or a storage's status
Expand Down

0 comments on commit 8d84356

Please sign in to comment.