[SOLVED] proxmoxer python library : How to read lxc config?

norbertk

Renowned Member
Jan 20, 2014
17
6
68
Hello all,
please apologize if this is Off Topic here.

I try to read the config of my lxcs with the python proxmoxer library but get an empty <proxmoxer.core.ProxmoxResource object at 0x0000014CC8E7E550> back.

I start the connection with the https backend :
Python:
    proxmox = ProxmoxAPI('xxxx.xx-xx.de', user='fffffff@pve',
                     password='8PFCUy7jkthaRxT3', verify_ssl=False)
The I write a loop as follows
Python:
    for node in proxmox.nodes.get():
        for lxc in proxmox.nodes(node['node']).lxc.get():
            vmid = lxc['vmid']
            c = proxmox.get ('nodes/%s/lxc/%i/config/' % (node['node'],  int(lxc['vmid'])))

The object c here is an <proxmoxer.core.ProxmoxResource object> without any useful content.

The base url is 'https://xxxx.xx-xx.dee:8006/api2/json/get/nodes/karpaten/lxc/200/config/'

This matches fine with pvesh:
Bash:
pvesh get  /nodes/karpaten/lxc/200/config/
which gives a useful result .

A trailing slash in the parameters doiws not change the result

As I said : Plase accept my apol.ogies if this is OT here and thanks for reading !

Norbert
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!