First, I want to thank Stéphane Graber and a LXD community for creating and supporting such an awesome technology as Linux containers. I find it quit flexible and easy to use. This is really, really awesome!
Now, let’s get to the point of my topic. I’m a system(s) engineer and currently exploring a LXD API’s documentation. My goal is to sort out available HTTP methods and configuration parameters, i.e.:
certificates
instances
events
images
networks
operations
profiles
projects
storage-pools
resources
cluster
There are some examples of using configuration parameters via such HTTP methods as PUT and PATCH in a current API documentation.
Input (replaces any existing config with the provided one):
{
“config”: {
“core.trust_password”: “my-new-password”,
“core.https_address”: “1.2.3.4:8443”
}
}
But the full list has not been found, unfortunately.
If it’s set to the true, the instance will be destroy on shutdown.
It’s not a config key, it’s a property which is why you see it in /1.0/instances. It’s visible in GET and can be set in PUT/PATCH.
The CLI lets you change it with lxc config edit or by passing --ephemeral at creation time.
Note that you can always pass --debug to the CLI to see what’s sent to the server.
Oh, probably my fault. Confused “parameters” and “property” terms, sry.
Then, how can I get the whole available list of “properties”?
By only exploring them via GET method?
All the struct attributes should be listed in the API doc under their respective endpoints in the example along with a comment explaining what they are, just like you found for ephemeral above.
The config keys, devices, … which some attributes take, those are listed under their respective docs (such as the valid options for config or devices in the case of instances).
Came to /1.0/instances/<name>/metadata.
How can I get the description of properties and available parameters?
Cannot understand what is changable and what is not. Couldn’t find info(
Properties are free for all, every image can set what they want, they don’t have any particular meaning and LXD doesn’t care about them other than showing them back to the user.