Difference between revisions of "Pylxd"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with "# Snippets ## Get IP addresses on container ``` #!usr/bin/env python3 from pylxd import Client client = Client() for p in client.containers.all(): print(p.name, p.state().net...")
(No difference)

Revision as of 15:46, 24 March 2020

Snippets

Get IP addresses on container

#!usr/bin/env python3
from pylxd import Client
client = Client()
for p in client.containers.all(): print(p.name, p.state().network['eth0']['addresses'][0]['address'])