Rest api lxc instance config

Adding and removing instance config

  1. lxc config device add …
  2. lxc config device remove …


  1. Patch ### /1.0/instances/<name>
    {config: { devices: { path: source: …}}}

But how to remove this very exact entry through api?
Read the the whole config.json and rebuild it without that entry and post the whole cleared thing back?

Yep, that’s exactly what the CLI does!
In this case, it modifies the devices dict to remove the entry and sends everything back.

To avoid race conditions, get the ETag header from GET and make sure to send it as If-Match in the PUT. That way if anything changed in between the two actions, you’ll get an error instead of potentially overwriting someone else’s changes.