api-test: add a short example shell script for now
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
021a381f18
commit
3d15cca7d6
22
api-test/example.sh
Normal file
22
api-test/example.sh
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example api-test client commands:
|
||||
echo "Calling /api/1/greet:"
|
||||
curl -XGET -H 'Content-type: application/json' \
|
||||
-d '{"person":"foo","message":"a message"}' \
|
||||
'http://127.0.0.1:3000/api/1/greet'
|
||||
echo
|
||||
|
||||
echo "Calling /api/1/mount/rootfs"
|
||||
# without the optional 'ro' field
|
||||
curl -XPOST -H 'Content-type: application/json' \
|
||||
-d '{"entry":{"mount_type":"volume","source":"/source","destination":"/destination"}}' \
|
||||
'http://127.0.0.1:3000/api/1/mount/rootfs'
|
||||
echo
|
||||
|
||||
echo "Calling /api/1/mount/rootfs again"
|
||||
# with the optional 'ro' field
|
||||
curl -XPOST -H 'Content-type: application/json' \
|
||||
-d '{"entry":{"mount_type":"volume","source":"/source","destination":"/destination","ro":true}}' \
|
||||
'http://127.0.0.1:3000/api/1/mount/rootfs'
|
||||
echo
|
@ -169,10 +169,10 @@ async fn greet_person_with(
|
||||
entry: "The mount point configuration to replace the entry with",
|
||||
},
|
||||
})]
|
||||
async fn update_mount_point(id: String, entry: MountEntry) -> Result<(), Error> {
|
||||
async fn update_mount_point(id: String, entry: MountEntry) -> Result<String, Error> {
|
||||
eprintln!("Got request to update mount point '{}'", id);
|
||||
eprintln!("New configuration: {:?}", entry);
|
||||
Ok(())
|
||||
Ok(format!("Updating '{}' with: {:?}", id, entry))
|
||||
}
|
||||
|
||||
//
|
||||
|
Loading…
x
Reference in New Issue
Block a user