How to pass cloud init yaml via API as config?

(Silentphantom62) #1

I am looking for the API equivalent of doing the below.

lxc launch ubuntu1804 test"$(cat network-config.yaml)"

I am using pylxd client and while creating a container I can pass a config dictionary.
How do I pass a yaml as a value to the in config object?

Yaml looks like:

version: 1
  - type: physical
    name: eth0
      - type: static
        address: <ip-address>
        gateway: <ip-address>
          - <ip-address>
          - <ip-address>