pylxd icon indicating copy to clipboard operation
pylxd copied to clipboard

No documentation about config for method `client.containers.create(config, wait=False)`

Open amirouche opened this issue 4 years ago • 4 comments

There is no documentation for the argument config of method client.containers.create(config, wait=False).

The documentation says:

This method requires the container config as the first parameter. The config itself is beyond the scope of this documentation. Please refer to the LXD documentation for more information.

What is the documentation that is refereed as "LXD documentation" ?

TODO: add a link in pylxd documentation to that documentation.

amirouche avatar May 20 '20 09:05 amirouche

Well if you notice the example at the docs you will see how is the pattern.

First the config value is a dictionary:

Check this :

config = {'name': 'DetectionSvc', 'source': {'type':'image', 'alias': 'DetectionSvc'},'profiles': ['default','brprof']}

  • name is the name of the container you want to creatre
  • alias is the name of the respective image
  • and the profile is the list with the profiles applied to the container.

So you can set the name,image and profile with your needs :)

I hope that I helped

tkasidakis avatar Feb 02 '21 17:02 tkasidakis

How did you find out?

amirouche avatar Feb 02 '21 18:02 amirouche

Actually from the docs and from some trial and error :). I am not fully familiar and I can't use it like the command like but the general idea is a dictionary with keys image profile etc and values the settings you want to apply

tkasidakis avatar Feb 02 '21 22:02 tkasidakis

that still need other config options

, 'source': {'type':'image', 'alias': 'DetectionSvc'}

whart are the ohter type of source? I want to load from the file , but without defination of source types i don' know how to load images from backup exports.

v3ss0n avatar Nov 05 '21 18:11 v3ss0n