diff --git a/docs/content/docs/libraries/lume/http-api.mdx b/docs/content/docs/libraries/lume/http-api.mdx index dcef8428..079a134a 100644 --- a/docs/content/docs/libraries/lume/http-api.mdx +++ b/docs/content/docs/libraries/lume/http-api.mdx @@ -49,6 +49,126 @@ curl --connect-timeout 6000 \ -X POST \ -H "Content-Type: application/json" \ -d '{ + "name": "ssd", + "path": "/Volumes/SSD/lume/vms" + }' \ + http://localhost:7777/lume/config/locations +``` + + + + +```python +import requests + +payload = { + "name": "ssd", + "path": "/Volumes/SSD/lume/vms" +} +r = requests.post("http://localhost:7777/lume/config/locations", json=payload, timeout=50) +print(r.json()) +``` + + + + +```typescript +const payload = { + name: 'ssd', + path: '/Volumes/SSD/lume/vms', +}; +const res = await fetch('http://localhost:7777/lume/config/locations', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(payload), +}); +console.log(await res.json()); +``` + + + + +### Remove VM Storage Location + +Remove a VM storage location. + +`DELETE: /lume/config/locations/:name` + +#### Example Request + + + + +```bash +curl --connect-timeout 6000 \ + --max-time 5000 \ + -X DELETE \ + http://localhost:7777/lume/config/locations/ssd +``` + + + + +```python +import requests + +r = requests.delete("http://localhost:7777/lume/config/locations/ssd", timeout=50) +print(r.status_code) +``` + + + + +```typescript +const res = await fetch('http://localhost:7777/lume/config/locations/ssd', { + method: 'DELETE', +}); +console.log(res.status); +``` + + + + +### Set Default VM Storage Location + +Set a storage location as the default. + +`POST: /lume/config/locations/default/:name` + +#### Example Request + + + + +```bash +curl --connect-timeout 6000 \ + --max-time 5000 \ + -X POST \ + http://localhost:7777/lume/config/locations/default/ssd +``` + + + + +```python +import requests + +r = requests.post("http://localhost:7777/lume/config/locations/default/ssd", timeout=50) +print(r.json()) +``` + + + + +```typescript +const res = await fetch('http://localhost:7777/lume/config/locations/default/ssd', { + method: 'POST', +}); +console.log(await res.json()); +``` + + + "name": "lume_vm", "os": "macOS", "cpu": 2, @@ -1113,4 +1233,4 @@ curl --connect-timeout 6000 \ --max-time 5000 \ -X POST \ -H "Content-Type: application/json" \ - -d '{ + -d '{ \ No newline at end of file